Uploaded image for project: 'Mahout'
  1. Mahout
  2. MAHOUT-1602

Euclidean Distance Similarity Math

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.9
    • 0.10.0
    • classic

    Description

      Within the file:

      /mrlegacy/src/main/java/org/apache/mahout/cf/taste/impl/similarity/EuclideanDistanceSimilarity.java

      Mentions that the implementation should be sqrt / (1 + distance).

      Once the equation is simplified, should be:
      1 / ((1 + distance) / sqrt)

      Coded:
      return 1.0 / ((1.0 + Math.sqrt(sumXYdiff2)) / Math.sqrt);

      But instead is (missing grouping brackets):
      1 / (1 + distance / sqrt )

      Coded:
      return 1.0 / (1.0 + Math.sqrt(sumXYdiff2) / Math.sqrt);

      Attachments

        Activity

          People

            sslavic Stevo Slavić
            leonfs Leonardo Fernandez Sanchez
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: