Blog posts

2021

Experimenting with a Custom Distance Based on Haversine with K Nearest Neighbors

In this blog post, I will discuss: (1) the Haversine distance, a distance metric designed for measuring distances between places on earth, (2) a customized distance metric I implemented, “HaversineEuclidean”, which I felt would be more appropriate in an analysis of the California Housing data, and (3) how to implement this custom metric in a K Nearest Neighbors Regression (KNN) with scikit-learn. The implementation is also relevant to other functionalities in sklearn.neighbors.

2020