public class JaccardDistance<T> extends java.lang.Object implements Distance<T[]>
The Jaccard coefficient measures similarity between sample sets, and is defined as the size of the intersection divided by the size of the union of the sample sets.
The Jaccard distance, which measures dissimilarity between sample sets, is complementary to the Jaccard coefficient and is obtained by subtracting the Jaccard coefficient from 1, or, equivalently, by dividing the difference of the sizes of the union and the intersection of two sets by the size of the union.
| Constructor and Description |
|---|
JaccardDistance()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> double |
d(java.util.Set<T> a,
java.util.Set<T> b)
Returns the Jaccard distance between sets.
|
double |
d(T[] a,
T[] b)
Returns the distance measure between two objects.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapply, applyAsDouble, D, Dpublic java.lang.String toString()
toString in class java.lang.Objectpublic double d(T[] a, T[] b)
Distancepublic static <T> double d(java.util.Set<T> a,
java.util.Set<T> b)