Azure ML - Automobile Price Predictor
Tags: azureml, automobile, pricing, aiml
Published: 2024-01-23 20:27:47

> 
The objective is to create and train a Machine Learning model to predict automobile price based on different parameters using Azure ML and public data set. We will also go a step further to set up and deploy web service.

**Steps:**

1) Navigate to https://studio.azureml.net/ and sign up / sign in.

2) Add new experiment using the (+) symbol at the bottom and select blank experiment.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7hnb8zccehy0wx16i66.png)

3) Leverage the public data set - Automobile price data set and drag it to the mapping area.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g9m7xi8m0ff5fqm1g9hc.png)

Click and select Visualization 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yje7wtc849833caiy54x.png)


4) Search experiment items for "Select Columns in Dataset". Drag it to the mapping area to include All columns
Excluding the column 'normalized-losses'.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yvzujf3jgrmav2h36lmc.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qilsrhqfnimmzzy6598p.png)


5) Link them as below.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uz2hq0lu3yx3cxc6e8ac.png)

6) Search experiment items for "Clean Missing Data". Drag it to the mapping area to the next step. Add the cleaning mode to remove entire row.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/460z2kg70t43pujok53w.png)

7) Save and Run experiment.

8) After careful feature engineering, determine the key parameters and select only those columns from the data set. In order to train the data set we also feed the price field.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wuttcy61vmh93yt3mm66.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w035usivl6pl26gyfy23.png)

9) Now we introduce a step to Split data. 75% of data will be used for training the model. Introduce the below step


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x323y9qg4skv89ogox1x.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/842nts0zmpnwz7ee9ado.png)

10) For price prediction, we will use linear regression to train the model. Introduce the below steps.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ksv8w8qfenstq6fcup7.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eti3l3kxebph4nezdn1m.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m2vtwk0sp9o49835ugfn.png)

11) Score the model

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s073i1sfs25po5hasu88.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3wlzp3phkx5ie82hksj.png)


12) Evaluate the model and visualize

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u0z6pgvarrdo9dd9mck1.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmym22upwxg14qa1180d.png)

13) The model is now ready to be deployed. Below changes are done to exclude exact price field in real time. We will use the Scored Labels.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5o6sxqcf5sin2kzg626i.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4k10jns03njwi8pjtjib.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n4ujcn3o9maimocay6hr.png)

14) Now we are ready to set the web service


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/58vt5rjwmfob4uvrs3b9.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dq7dfn3w7z594oh28pqw.png)

15) We will feed the input of web service to the score model. Run the experiment and deploy the web service


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hxe7h8hdzlp1lk7cus48.png)

16) API key has been generated for further usage of web services.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/foxxywfhrxh0jsdfoi0n.png)

17) Test the model with real time data


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jpvtcgzllqaatrqx24wz.png)