net.sf.javaml.distance
Class JaccardIndexSimilarity
java.lang.Object
net.sf.javaml.distance.AbstractSimilarity
net.sf.javaml.distance.JaccardIndexSimilarity
- All Implemented Interfaces:
- java.io.Serializable, DistanceMeasure
public class JaccardIndexSimilarity
- extends AbstractSimilarity
Jaccard index. The distance between two sets is computed in the following
way:
n1 + n2 - 2*n12
D(S1, S2) = ------------------
n1 + n2 - n12
D(S1,S2) = |S1 ^ S2|
---------
|S1 u S2|
Where n1 and n2 are the numbers of elements in sets S1 and S2, respectively,
and n12 is the number that is in both sets (section).
- Version:
- %SVN.VERSION%
- Author:
- Thomas Abeel (thomas@abeel.be)
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JaccardIndexSimilarity
public JaccardIndexSimilarity()
measure
public double measure(Instance a,
Instance b)
- Description copied from interface:
DistanceMeasure
- Calculates the distance between two instances.
- Returns:
- the distance between the two instances
Copyright © 2006-2010 - Thomas Abeel - All Rights Reserved.