Package cc.mallet.types
Class NormalizedDotProductMetric
- java.lang.Object
-
- cc.mallet.types.NormalizedDotProductMetric
-
- All Implemented Interfaces:
CachedMetric
,Metric
public class NormalizedDotProductMetric extends java.lang.Object implements CachedMetric
Computes 1 - [/ sqrt ( * )] aka 1 - cosine similarity
-
-
Constructor Summary
Constructors Constructor Description NormalizedDotProductMetric()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(SparseVector a, int hashCodeA, SparseVector b, int hashCodeB)
double
distance(SparseVector a, SparseVector b)
-
-
-
Method Detail
-
distance
public double distance(SparseVector a, SparseVector b)
-
distance
public double distance(SparseVector a, int hashCodeA, SparseVector b, int hashCodeB)
- Specified by:
distance
in interfaceCachedMetric
-
-