de.lmu.ifi.dbs.elki.distance.distancefunction
Class CosineDistanceFunction
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.CosineDistanceFunction
- All Implemented Interfaces:
- DistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDoubleDistanceFunction<NumberVector<?,?>>, InspectionUtilFrequentlyScanned, Parameterizable
public class CosineDistanceFunction
- extends AbstractCosineDistanceFunction
Cosine distance function for feature vectors.
The cosine distance is computed from the cosine similarity by
1-(cosine similarity)
.
STATIC
public static final CosineDistanceFunction STATIC
- Static instance
CosineDistanceFunction
@Deprecated
public CosineDistanceFunction()
- 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 from the cosine similarity by
1-(cosine similarity)
.
- 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