Azure ML Car Price Prediction Experiment : ML-Series (3 of 10)

In Progress (Will be completed by 2 April 2018 EOD)

Step 1. Open and sign in there . You can even choose free option.


Step 2. After Sign in you must have this type of work-space where you can create a new experiment.

ML workbench - 1

Step 3. Now click +NEW  at the bottom left of the screen to create a new experiment and then select Blank Experiment as shown below

ML New Experiment- 2

Step 4. Now give the name of your experiment as “Car Price Prediction Exercise” by Entering the text 

ML Naming the Experiment- 3

Step 5. Now In the Search box at the top left hand side, enter automobile to find the data-set labeled as Automobile price data (Raw)

Ml Drag Automobile Dataset 4

Step 6 .  Now we will prepare the data  to ensure missing values are addressed prior to running the prediction exercise. 

  • Now in the Search box located in the top left hand side, enter select columns and located the “Select Columns” module.
  • Drag the module to the newly created experiment canvas. 
  • Connect the output port of the Automobile price data (Raw) dataset to the input port of the Select Columns in Dataset module

ML Select Column in Dataset 5

Step 7 : 

  • Select the Select Columns in Dataset box
  • Click Launch column selector in the Properties pane as shown in screenshot below.
  • Click With rules located on the left
  • Under Begin With, click All columns. This directs Select Columns in Dataset to pass through all the columns (except those columns we’re about to exclude).
  • From the drop-downs, select Exclude and column names, and then click inside the text box. A list of columns is displayed. Select normalized-losses, and it’s added to the text box.
  • Click the check mark to close the column selector.ML Normalized Losses 6

Why we needed above step? The properties pane for Select Columns in Dataset now shows that all columns from the dataset will pass through except normalized-losses

Step – 8  Clean Missing Data and Run

  • Drag the Clean Missing Data module to the experiment canvas and connect it to the Select Columns in Dataset module
  • In the Properties pane, select Remove entire row under Cleaning mode.This directs Clean Missing Data to clean the data by removing rows that have any missing values.

ML Clean missing Data and Run 7

Step – 9  Defining Features

Features are measurable properties that are of interest. In Automotive Price dataset, each row represents one car, and each column is a feature of that car. Experimentation and knowledge about the problem you want to solve are needed to find a good set of features to create a predictive model.

This experiment will build a model that uses a subset of the features in the automotive dataset.  These features include:
make, body-style, wheel-base, engine-size, horsepower, peak-rpm, highway-mpg, price

  • Find and drag another Select Columns in the Dataset module to the experiment canvas
  • Connect the left output port of the Clean Missing Data module to the input of the Select Columns in Dataset module
  • Double-click the module and type Select features for prediction
  • Click Launch column selector in the Properties pane
  • Click With rules
  • Click No columns under Begin With
  • Select Include and column names in the filter row
  • Select the list of column names (as listed above prior to the start of Step 3’s steps) in the text box
  • Click the check mark button to confirm the selection

ML Select Columns 8.PNG

Step – 10 Now Selecting and Applying a Learning Algorithm (regression algorithm)

Regression is used to predict a number which will come in handing when predicting pricing. More specifically, this experiment will use the simple linear regression model. The data itself will be used for both training the model and testing.  This is completed by splitting the data into separate training and testing datasets.

  • Find, select and drag the Split Data module to the experiment canvas
  • Connect the Split Data module to the last Select Columns in Dataset module
  • Click the Split Data module
  • In the Properties pane to the right of the canvas, find the Fraction of rows in the first output dataset () and set it to 0.75
  • Run the experiment

ML Split Data 9

  • Now Expand the Machine Learning category in the module palette to the left of the canvas to select the learning algorithm
  • Expand Initialize Model
    NOTE: This displays several categories of modules that can be used to initialize machine learning algorithms
  • Select the Linear Regression module under the Regression category and drag it to the experiment canvas

ML Linear Regression 10

  • Find and drag the Train Model module to the experiment canvas
  • Connect the output of the Linear Regression module to the left input of the Train Model module, and connect the training data output (left port) of the Split Data module to the right input of the Train Model module
  • Click the Train Model module
  • Select Launch column selector in the Properties pane
  • Select the price column and move it to the Selected columns list (This is the value that the experiment is going to predict)
  • Click the check mark button to confirm the selection

ML Predict Price 11

  • Run the experiment
  • Click the output port of Score Model and select Visualize to view the output from the Score Model module

ML Score The Model 12.PNG

Here you can see the Final scores for each Car or each row of data.

ML Final Scores 13.PNG

Step – 11 Deploy it as a Web Service

Now click on Setup Web Service

ML Web Service 14.PNG

This is how it looks after adding Predictive Web Service

ML Predictive Web Service Added 15

Step – 12 : Deploy the Web Service

Here is your Deployed Testable Web Service, now after clicking Test, you can enter Values and See the Predicted Output.

Ml Deployed Web SErvice 16.PNG






References :

Microsoft Documentation

Special Thanks to Anthony Bartolo

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s