Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for cosine distance #30

Closed
ajallooeian opened this issue Mar 24, 2016 · 2 comments
Closed

Request for cosine distance #30

ajallooeian opened this issue Mar 24, 2016 · 2 comments

Comments

@ajallooeian
Copy link

Hi,

I have been using somoclu for a week now and really enjoying it. I would appreciate it if cosine distance is also implemented, as it is useful for many document matching application.

Thanks,
Mos

@peterwittek
Copy link
Owner

We routinely use Somoclu in text mining and it makes little sense to implement the cosine distance because it is almost identical to the Euclidean, as long as your data instances are normalized. Take two vectors, x and y. Then (d(x,y))^2=sum_k (x_k-y_k)^2 = |x|^2+|y|^2 - 2(x,y). Since |x|^2=|y|^2=1, this is just 2(1-(x,y)), so a separate cosine distance would result in the exact same topology.

@ajallooeian
Copy link
Author

Thanks a lot for this to-the-point explanation. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants