Package cc.mallet.types
Class Minkowski
- java.lang.Object
-
- cc.mallet.types.Minkowski
-
-
Constructor Summary
Constructors Constructor Description Minkowski(double q)
Constructor for Minkowski metric.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(SparseVector a, SparseVector b)
Gives the Minkowski distance between two vectors.static Metric
getMetric(double q)
-
-
-
Method Detail
-
getMetric
public static Metric getMetric(double q)
-
distance
public double distance(SparseVector a, SparseVector b)
Gives the Minkowski distance between two vectors. distance(x,y) := \left( \Sum_i=0^d-1 \left| x_i - y_i \right|^q \right)^\frac{1}{q}
-
-