-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Error thrown when using t-SNE with 'cosine' as metric #5772
Copy link
Copy link
Closed
Description
Hi,
When I use 'cosine' as metric for sklearn.manifold.tsne I get the following error:
"ValueError: All distances should be positive, either the metric or precomputed distances given as X are not correct".
As the codomain of cosine distance is [-1,1] all output from pairwise comparison will not be positive.
For euclidean distance there is a hard coded solution for keeping distances positive by squaring them (passed as parameter).
For cosine distance I suspect that a simply 'absoluting' the values should be a fix to make it run, however seems like there should be a proper understanding of the algorithm before doing a fix (which I currently do not have unfortunately)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels