Package smile.math.distance
Class SparseMinkowskiDistance
java.lang.Object
smile.math.distance.SparseMinkowskiDistance
- All Implemented Interfaces:
Serializable
,ToDoubleBiFunction<SparseArray,
,SparseArray> Distance<SparseArray>
,Metric<SparseArray>
Minkowski distance of order p or Lp-norm, is a generalization of
Euclidean distance that is actually L2-norm. You may also provide
a specified weight vector.
- See Also:
-
Constructor Summary
ConstructorDescriptionSparseMinkowskiDistance
(int p) Constructor.SparseMinkowskiDistance
(int p, double[] weight) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondouble
d
(SparseArray x, SparseArray y) Returns the distance measure between two objects.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface smile.math.distance.Distance
apply, applyAsDouble, D, D
-
Constructor Details
-
SparseMinkowskiDistance
public SparseMinkowskiDistance(int p) Constructor.- Parameters:
p
- the order of Minkowski distance.
-
SparseMinkowskiDistance
public SparseMinkowskiDistance(int p, double[] weight) Constructor.- Parameters:
p
- the order of Minkowski distance.weight
- the weight vector.
-
-
Method Details