JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.alsUtility
Class Tanimoto

java.lang.Object
  extended bygov.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|)


Constructor Summary
Tanimoto()
           
 
Method Summary
protected static double calculate(double unionSize, double intersectionSize)
           
static double distance(double a, double b)
           
static double distance(KeyCounter a, KeyCounter b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tanimoto

public Tanimoto()
Method Detail

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

JavaGenes, NASA Ames. Written largely by Al Globus