striatum
striatum

Reputation: 1598

Python `sklearn.metrics.pairwise` `cosine_similarity` or `cosine_distance` theoretical range

Cosine similarity/distance should be bounded between -1 and +1. Yet, sklearn.metrics.pairwise gives values > +1. Can anyone explain this behaviour please?

Upvotes: 0

Views: 506

Answers (1)

Learning is a mess
Learning is a mess

Reputation: 8277

pairwise default distance is Euclidean which is not bounded from above, hence you should not be surpised to see some values greater than 1.

Upvotes: 1

Related Questions