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

Euclidean distance #13

Open
Emma1066 opened this issue May 3, 2019 · 3 comments
Open

Euclidean distance #13

Emma1066 opened this issue May 3, 2019 · 3 comments

Comments

@Emma1066
Copy link

Emma1066 commented May 3, 2019

Hi, thanks for sharing this greate project!
There is one line of code I can't understand:
rmse = (sum(map(lambda x: x**2, differences)) / len(differences))**0.5
As far as I know, if x and y are two points in n-dimension space, the euclidean distance between them is

d(x,y) = sqrt((x1-y1)^2 + (x2-y2)^2 + ... + (xn-yn)^2)

So why in the code the sum term is divided by len(differences) ?
Thanks a lot if you could help me.

@leohill33
Copy link

I have the same question. Isn't the euclidean distance between (1,1), (2,2) supposed to be √2? :目

@damjankuznar
Copy link
Owner

damjankuznar commented Aug 18, 2020

Because this is not actually euclidean distance, but rather root mean square error (RMSE). See here https://en.wikipedia.org/wiki/Root-mean-square_deviation
Does that answer your question?

@leohill33
Copy link

Because this is not actually euclidean distance, but rather root mean square error (RMSE). See here https://en.wikipedia.org/wiki/Root-mean-square_deviation
Does that answer your question?

Got it. Thank you so much for your work on explaining how LOF works. :)

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

No branches or pull requests

3 participants