de.lmu.ifi.dbs.elki.distance.distancefunction
Class ArcCosineDistanceFunction
java.lang.Object
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractCosineDistanceFunction
de.lmu.ifi.dbs.elki.distance.distancefunction.ArcCosineDistanceFunction
- All Implemented Interfaces:
- DistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDoubleDistanceFunction<NumberVector<?,?>>, InspectionUtilFrequentlyScanned, Parameterizable
public class ArcCosineDistanceFunction
- extends AbstractCosineDistanceFunction
Cosine distance function for feature vectors.
The cosine distance is computed as the arcus from the cosine similarity
value, i.e., arccos(<v1,v2>)
.
STATIC
public static final ArcCosineDistanceFunction STATIC
- Static instance
ArcCosineDistanceFunction
@Deprecated
public ArcCosineDistanceFunction()
- Deprecated. Use static instance!
- Provides a CosineDistanceFunction.
doubleDistance
public double doubleDistance(NumberVector<?,?> v1,
NumberVector<?,?> v2)
- Computes the cosine distance for two given feature vectors.
The cosine distance is computed as the arcus from the cosine similarity
value, i.e.,
arccos(<v1,v2>)
.
- Parameters:
v1
- first feature vectorv2
- second feature vector
- Returns:
- the cosine distance for two given feature vectors v1 and v2
toString
public String toString()
- Overrides:
toString
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object