yzhao062/pyod

knn metric cosine ValueError: Unrecognized metric 'cosine'

Open

#221 aberto em 19 de ago. de 2020

Ver no GitHub
 (3 comments) (0 reactions) (1 assignee)Python (1.308 forks)batch import
bughelp wanted

Métricas do repositório

Stars
 (7.762 stars)
Métricas de merge de PR
 (Mesclagem média 4d 17h) (14 fundiu PRs em 30d)

Description

clf = KNN(metric="cosine")
clf.fit(train_data)

results in

sklearn/neighbors/_binary_tree.pxi in sklearn.neighbors._ball_tree.BinaryTree.__init__()

sklearn/neighbors/_dist_metrics.pyx in sklearn.neighbors._dist_metrics.DistanceMetric.get_metric()

ValueError: Unrecognized metric 'cosine'

Also brute and kd_tree don't support cosine, meaning that cosine is not supported by any algorithm.

Guia do colaborador