For some reason, I have to find the 10~30 nearest neighbors for each samples in a geo-dataset(have lat, lon, and some categorical features, rows >10M) with various kinds of distance metrics, mostly Haversine Distance or Gower Distance.
Here, I need a fast implementation/package for obtaining the index and actual distance of the samples for each data point. Actually, the function
FNN package works very well and it meets my requirements. Unfortunately, it does not support custom distance settings and only provides euclidean distance.
I was wondering that is there any other package that can perform knn at least with Haversine Distance and output the index and distance in a very fast manner?