I was trying to use DBSCAN algorithm from scikit-learn library with cosine metric but was stuck with the error. The line of code is
db = DBSCAN(eps=1, min_s
The indexes in sklearn (probably - this may change with new versions) cannot accelerate cosine.
Try algorithm='brute'
.
For a list of metrics that your version of sklearn can accelerate, see the supported metrics of the ball tree:
from sklearn.neighbors.ball_tree import BallTree
print(BallTree.valid_metrics)