Menu

#2 Euclidean Distance always returns 0.0

closed
nobody
None
5
2008-06-27
2007-06-28
Anonymous
No

I recently installed simmetrics v 1.6 and i'm having a strange result from euclidean distance function.

I just downloaded the jar and the source, and start playing with the SimpleExample.java file, when trying with the Euclidean distance, it always return 0.0, unless inputing two equal strings.

abb aba return 0.0

abc abd return 0.0

abc abc return 1.0

I tried with a lot of Strings of different sizes, and had the same result.

Luis Ibáñez
ldibanyez@gmail.com

Discussion

  • ReverendSam

    ReverendSam - 2008-06-27

    Logged In: YES
    user_id=1151038
    Originator: NO

    euclidean distance is a vector based approach so works on the level of whole tokens not characters, the results you get are correct, not a bug.

    i.e.

    "abb" "abb" = 1.0
    "abb" "jpo" = 0.0
    "abb tuo" "tuo jpo" = approx 0.5

     
  • ReverendSam

    ReverendSam - 2008-06-27
    • status: open --> closed
     

Log in to post a comment.