Business data Mining Techniques

profileAsianhouse@2
carpricepredictionstepswithscreenshot.docx

Toyota Corolla prediction on Azure ML Studio

About data: The data set includes sale prices and vehicle characteristics of 1436 used Toyota Corollas. The objective here is to predict the sale price of a used automobile.

Data Description

Id: Record ID

Model: Model Description

Price: Offer Price in EUROs

Age_08_04: Age in months as in August 2004

Mfg_Month: Manufacturing month (1-12)

Mfg_Year: Manufacturing Year

KM: Accumulated Kilometers on odometer

Fuel_Type: Fuel Type (Petrol, Diesel, CNG)

HP: Horse Power

Met_Color: Metallic Color? (Yes=1, No=0)

Color: Color (Blue, Red, Grey, Silver, Black, etc.)

Automatic: Automatic ((Yes=1, No=0)

CC: Cylinder Volume in cubic centimeters

Doors: Number of doors

Cylinders: Number of cylinders

Gears: Number of gear positions

Quarterly_Tax: Quarterly road tax in EUROs

Weight: Weight in Kilograms

Mfr_Guarantee: Within Manufacturer's Guarantee period (Yes=1, No=0)

BOVAG_Guarantee: BOVAG (Dutch dealer network) Guarantee (Yes=1, No=0)

Guarantee_Period: Guarantee period in months

ABS: Anti-Lock Brake System (Yes=1, No=0)

Airbag_1: Driver Airbag (Yes=1, No=0)

Airbag_2: Passenger Airbag (Yes=1, No=0)

Airco: Airconditioning (Yes=1, No=0)

Automatic_airco: Automatic Airconditioning (Yes=1, No=0)

Boardcomputer: Board computer (Yes=1, No=0)

CD_Player: CD Player (Yes=1, No=0)

Central_Lock: Central Lock (Yes=1, No=0)

Powered_Windows: Powered Windows (Yes=1, No=0)

Power_Steering: Power Steering (Yes=1, No=0)

Radio: Radio (Yes=1, No=0)

Mistlamps: Mist lamps (Yes=1, No=0)

Sport_Model: Sport Model (Yes=1, No=0)

Backseat_Divider: Backseat Divider (Yes=1, No=0)

Metallic_Rim: Metallic Rim (Yes=1, No=0)

Radio_cassette: Radio Cassette (Yes=1, No=0)

Parking_Assistant: Parking assistance system (Yes=1, No=0)

Tow_Bar: Tow Bar (Yes=1, No=0)

Steps of Prediction

1) An overview of Azure ML studio

2) Pick dataset and create experiments

3) Summarize and clean

4) Prediction

5) Set Up Web Service

Follow the below steps:

1) Azure Machine Learning Studio is a collaborative, drag-and-drop tool for building, testing, and deploying predictive analytics solutions on your data. Machine Learning Studio publishes models as web services that can easily be consumed by custom apps or BI tools such as Excel. Machine Learning Studio is where data science, predictive analytics, cloud resources, and your data meet. Go to https://studio.azureml.net/

Sign up if you don’t have existing account. It’s free (the free workspace package). Once signed in, you'll see the following tabs on the left:

PROJECTS - Collections of experiments, datasets, notebooks, and other resources representing a single project

EXPERIMENTS - Experiments that you have created and run or saved as drafts

WEB SERVICES - Web services that you have deployed from your experiments

NOTEBOOKS - Jupyter notebooks that you have created

DATASETS - Datasets that you have uploaded into Studio

TRAINED MODELS - Models that you have trained in experiments and saved in Studio

SETTINGS - A collection of settings that you can use to configure your account and resources.

2)

I) Pick dataset: Here you can import your dataset or here lots of sample dataset to practice experiment. To import your dataset –

· Go to dataset.

· Click bellow New

· Click from local file

· Click choose file

· Now select your file

II) Create Experiment:

· Go to experiment

· Click bellow new

· Click blank experiment

· Click saved datasets

· Select your dataset from My Datasets

· In samples there are some samples datasets for practice.

· Drag your data from my datasets and drop onto dashboard.

· Click the experiment name and rename it.

· Save the experiment

3)

I) Summarize:

· Search ‘Summarize Data’ on “Search experiment items

· Drag ‘Summarize Data’ and drop onto dashboard

· Then connect dataset with ‘Summarize Data’

· Run the experiment

· Now we can we the summary of our dataset by right click on Summarize Data > Result dataset > Visualization.

· Here we can see missing values too.

II) Clean:

· Here we have no missing value in our dataset, so we don’t have to clean dataset. But we can clean dataset by using “Clean missing data”.

· We can clean by two method. One is removing the missing data column or row. Or placed a prediction value.

· To remove, click lunch column sector and select column by “By Name” or “With Rules

· To replace, click cleaning mode. “Replace with MICE” for few missing values and “Replace using probabilistic PCA” for lots missing values. These two gives much accurate prediction value.

4) Prediction:

· We will predict the price based on some benefit, so we will select some column include price column. Drag and drop ‘Select Column in Dataset’ item and connect with our dataset. Click lunch column selector and select ‘Price’, ‘Fuel_Type’, ‘KM’, ‘HP’, ‘Met_Color’, ‘Automatic’, ‘Cylinders’, ‘Gears’.

· Drag and drop ‘Split Data’ item and connect with ‘Select Column in dataset’. Enter value 0.7 in “Fraction of rows”.

· Drag and drop ‘Linear Regression’ and ‘Train Model’ items

· Connect “Train Model” item with ‘Split Data’ item and ‘Linear Regression’ item and select ‘Price’ column.

· Drag and drop ‘Score model’ and ‘Evaluate model’ items. Connect ‘Score model’ with ‘Train Model’ and ‘Split Data’ items. And connect ‘Evaluate model’ With ‘Score model’.

Hold the Ctrl key

· Now save and run the experiment.

· Now we can see our Scored Labels by visualize from ‘Score Model’ item. And error histogram from ‘Evaluate Model’ item.

5) SETUP WEBSERVICE:

Machine Learning Studio web services provide an interface between an application and a Machine Learning Studio workflow scoring model. An external application can communicate with a Machine Learning Studio workflow scoring model in real time. A call to a Machine Learning Studio web service returns prediction results to an external application. To make a call to a web service, you pass an API key that was created when you deployed the web service.

Once you've trained your model, you're ready to convert your training experiment into a predictive experiment to score new data. By converting to a predictive experiment, you're getting your trained model ready to be deployed as a scoring web service. Users of the web service can send input data to your model and your model will send back the prediction results. As you convert to a predictive experiment, keep in mind how you expect your model to be used by others.

To convert training experiment to a predict experiment:

· Click ‘Run’ and then select ‘Predictive Web Service’ from ‘Set Up Web Service’ button.

· Now in Prediction experiment remove connection between ‘web services input’ and ‘Select Column in Dataset’ items. Connect ‘web services input’ item with ‘Score model’ item.

· Remove ‘Price’ column from ‘Select Column in Dataset’ items.

· Click ‘Run’ and then ‘Deploy Web Service’ at the bottom of the experiment canvas.

· Click ‘REQUEST/RESPONS’ to see the experiment code in C#/Python/R.

· Click ‘Test’ to predict a price.

Here predicted price is 17512.7138.