gov.nasa.alsUtility
Class Tanimoto
java.lang.Object
gov.nasa.alsUtility.Tanimoto
- public class Tanimoto
- extends java.lang.Object
calculates the Tanimoto coefficient for different data structures. The Tanimoto coefficient
for sets a and b is 1.0 - (|a|/|b|)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Tanimoto
public Tanimoto()
distance
public static double distance(double a,
double b)
- Returns:
- 1.0 maximum/minimum
distance
public static double distance(KeyCounter a,
KeyCounter b)
- Returns:
- 1.0 - (|a|/|b|) considering the count of each element in a and b
calculate
protected static double calculate(double unionSize,
double intersectionSize)
- Returns:
- Tanimoto coefficient handling 0 appropriately