Is there a way find nearest neighbors with BallTree or KDTree using cosine similarity?
try to normalize your matrix and use euclidian metric.
I have very sparse and huge rating data which I should find top k neighbors for each session. I need to compare approximate and exact nearest neighbor algorithms but since the data is very big and sparse the computation of the exact method is taking days to compute with brute force. I want to use KD Trees or Ball Trees but they are not supporting cosine distance. Is there a way to convert other distance measures to cosine similarity by math or is there any other way to compute exact neighborhood?