T - type of the tokenpublic final class JaccardSimilarity<T> extends Object implements SetMetric<T>
jaccard index(a,b) = ( |a & b| ) / ( | a or b | )
This metric is identical to the matching coefficient which operates on lists.
This class is immutable and thread-safe.
| Constructor and Description |
|---|
JaccardSimilarity() |
| Modifier and Type | Method and Description |
|---|---|
float |
compare(Set<T> a,
Set<T> b)
Measures the similarity between sets a and b.
|
String |
toString() |
public float compare(Set<T> a, Set<T> b)
SetMetricCopyright © 2014–2018. All rights reserved.