[
https://issues.apache.org/jira/browse/MAHOUT-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14085465#comment-14085465
]
Leonardo Fernandez Sanchez commented on MAHOUT-1602:
----------------------------------------------------
Hi Ted,
First of all thanks for the quick reply.
There is definitely something wrong. I followed all your explanation and it
could make sense. But considering what you said, the equation in the comments
that might be the "incorrect" also falls under the category of:
{code}
1/d
{code}
So I wouldn't know, not a matematician, not good enough =(. I tried to get some
graphs in Wolphram Alfa to see if I can spot the truth... didn't happen... =(
But someone will have the answer and we will all benefit from it!!
Either way or the comment has to change or the code has to change..
> Euclidean Distance Similarity Math
> -----------------------------------
>
> Key: MAHOUT-1602
> URL: https://issues.apache.org/jira/browse/MAHOUT-1602
> Project: Mahout
> Issue Type: Bug
> Components: Collaborative Filtering, Math
> Reporter: Leonardo Fernandez Sanchez
>
> Within the file:
> /mrlegacy/src/main/java/org/apache/mahout/cf/taste/impl/similarity/EuclideanDistanceSimilarity.java
> Mentions that the implementation should be sqrt(n) / (1 + distance).
> Once the equation is simplified, should be:
> 1 / ((1 + distance) / sqrt(n))
> Coded:
> return 1.0 / ((1.0 + Math.sqrt(sumXYdiff2)) / Math.sqrt(n));
> But instead is (missing grouping brackets):
> 1 / (1 + distance / sqrt (n))
> Coded:
> return 1.0 / (1.0 + Math.sqrt(sumXYdiff2) / Math.sqrt(n));
--
This message was sent by Atlassian JIRA
(v6.2#6252)