Dataset from Cardekho, leading car sale platform in India, contains information about used cars, with features like km_driven, fuel type, transmission type, number of previous owners and present retail price.
To predict the car resale price and to productionize the project to be used in real world.
Python version: 3.7
Packages: pandas, numpy, matplotlib, seaborn, sklearn, pickle, flask
Kaggle source: https://www.kaggle.com/nehalbirla/vehicle-dataset-from-cardekho
Github repo: https://github.com/chekwei4/Car_Resale
Ipynb notebook: https://github.com/chekwei4/Car_Resale/blob/main/car_price_local.ipynb
Heroku App: https://car-price-app-1.herokuapp.com/
Key steps:
Categorical variables were one hot encoded to give dummy variables.
Age of car feature was created by substracting current year with year which car was bought.
RandomizedSearchCV performed with RandomForestRegressor to give best hyperparameters.
R2: 0.92
MSE: 1.84
Distribution plot
y_test against y_pred
Scatter plot
y_test against y_pred
Simple HTML file that allows user to input the key parameters required for model to predict.
Key steps:
-
pickle the trained model
-
create new virtual environment and requirements.txt
-
wrap app in Flask API
-
deploy app onto Heroku, with github repo connection
Heroku App: https://car-price-app-1.herokuapp.com/
https://blog.usejournal.com/why-and-how-to-make-a-requirements-txt-f329c685181e
Youtube: Krish Naik, Ken Jee