@Alias(value="cosine") public class CosineDistanceFunction extends AbstractSpatialDistanceFunction
1-(cosine similarity)
.Modifier and Type | Class and Description |
---|---|
static class |
CosineDistanceFunction.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
static CosineDistanceFunction |
STATIC
Static instance
|
Constructor and Description |
---|
CosineDistanceFunction()
Deprecated.
Use static instance
|
Modifier and Type | Method and Description |
---|---|
double |
distance(NumberVector v1,
NumberVector v2)
Computes the cosine distance for two given feature vectors.
|
boolean |
equals(Object obj) |
SimpleTypeInformation<? super NumberVector> |
getInputTypeRestriction()
Get the input data type of the function.
|
double |
minDist(SpatialComparable mbr1,
SpatialComparable mbr2)
Computes the distance between the two given MBRs according to this distance
function.
|
String |
toString() |
instantiate
dimensionality, dimensionality, dimensionality, dimensionality
isMetric, isSymmetric
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isMetric, isSymmetric
public static final CosineDistanceFunction STATIC
@Deprecated public CosineDistanceFunction()
STATIC
instead.public double distance(NumberVector v1, NumberVector v2)
1-(cosine similarity)
.distance
in interface NumberVectorDistanceFunction<NumberVector>
distance
in interface PrimitiveDistanceFunction<NumberVector>
distance
in class AbstractPrimitiveDistanceFunction<NumberVector>
v1
- first feature vectorv2
- second feature vectorpublic double minDist(SpatialComparable mbr1, SpatialComparable mbr2)
SpatialPrimitiveDistanceFunction
mbr1
- the first MBR objectmbr2
- the second MBR objectpublic SimpleTypeInformation<? super NumberVector> getInputTypeRestriction()
DistanceFunction
getInputTypeRestriction
in interface DistanceFunction<NumberVector>
getInputTypeRestriction
in interface PrimitiveDistanceFunction<NumberVector>
getInputTypeRestriction
in class AbstractNumberVectorDistanceFunction
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.