Nearest Neighbors in Python given the distance matrix
Want to add to ford's answer that you have to do like this
metric = DistanceMetric.get_metric('pyfunc',func=/your function name/)
You cannot just put your own function as the second argument, you must name the argument as "func"
I have to apply Nearest Neighbors in Python, and I am looking ad the scikit-learn and the scipy libraries, which both require the data as input, then will compute the distances and apply the algorithm.
In my case I had to compute a non-conventional distance, therefore I would like to know if there is a way to directly feed the distance matrix.