Starting with latitude/longitude data (in radians), I’m trying to efficiently find the nearest n neighbors, ideally with geodesic (WGS-84) distance.
Right now I’m u
The main reason for why your metric is slow is that it written in Python while other metrics in sklearn are written in Cython/C++/C.
So as for instance discussed here for Random Forests or here you would have to implement your metric in Cython, fork your own version of BallTree and include your custom metric there.