public interface DistanceMeasure extends Serializable
Modifier and Type | Method and Description |
---|---|
double |
distance(VectorWithNorm v1,
VectorWithNorm v2)
Measures the distance between two vectors.
|
default int |
findClosest(VectorWithNorm[] centroids,
VectorWithNorm point)
Finds the index of the closest center to the given point.
|
static DistanceMeasure |
getInstance(String distanceMeasure) |
static DistanceMeasure getInstance(String distanceMeasure)
double distance(VectorWithNorm v1, VectorWithNorm v2)
Required: The two vectors should have the same dimension.
default int findClosest(VectorWithNorm[] centroids, VectorWithNorm point)
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.