For scikit-learn’s KNN package, can one specify a pairwise distance metric (from the package sklearn.metrics.pairwise) that isn’t the p-norm, or Minkowski distance? For example, could I use the RBF kernel? Or even the cosine distance?
For scikit-learn’s KNN package , can one specify a pairwise distance metric (from the
Share
Unfortunately the BallTree algorithm that is used to compute fast exact NN search on low to medium number of dimensions cannot work with arbitrary metrics.