This repository contains the code, data and images used for the tutorial on custom metrics for kNN regression, published on towardsdatascience.com: https://medium.com/p/custom-user-defined-metrics-with-nearest-neighbors-regression-in-scikit-learn-8bec2f303499?source=email-1e4964370d8--writer.postDistributed&sk=579bbb775e7a32849996809ab1efe330.
-
kNN_regression.py: contains the code used to calculate rmse with leave-one-out CV with kNN regression
-
dataset.csv: contains 2019 daily average temperatures of weather station CA00504K80K in Canada (data obtained from NOAA climate.gov: https://www.climate.gov/maps-data/dataset/daily-temperature-and-precipitation-reports-data-tables)
-
figures: folder with figures and equations used during tutorial
The necessary packages (with the tested versions with Python 3.8.5) are specified in the file requirements.txt. These packages can be installed with pip:
pip3 install -r requirements.txt
© Marcos del Cueto Cordones
Licensed under the MIT License.