Project-Predicting Car Prices with K-nearest Neighbors

This solution is attempted with an aim to make such predictions based on k-nearest neighbors completely modular. Thus four general functions are written which can be used with any dataset:
a. knn_test_train: returns rmse values for any dataset, any features and any number of k values.
b. knn_min:: returns min rmse values and their corresponding k-values for any dataset, any features and any number of k vlaues
c. nn_max: returns max rmse values and their corresponding k-values for any dataset, any features and any number of k vlaues
d. kfold_avg_rmse: Carries out k-fold cross validation, and returns average rmse and average SD for any dataset, any features and any number of folds.

Feedback on any errors will be greatly appreciated.

https://app.dataquest.io/m/155/guided-project%3A-predicting-car-prices/6/next-stepsProject-Predicting Car Prices with K-nearest Neighbors.ipynb (723.4 KB)



Click here to view the jupyter notebook file in a new tab
1 Like

Hello @saquibmehmood1, Nice work you’ve done here. This is a very detailed project. When you have time it would be great if you could do Explanatory Data Analysis (EDA), this will make you obtain more insights.

Happy Learning.

Thanks a lot for taking the time to review.

1 Like