public abstract class AbstractCosineDistanceFunction extends AbstractVectorDoubleDistanceFunction
Constructor and Description |
---|
AbstractCosineDistanceFunction()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected double |
angle(NumberVector<?,?> v1,
NumberVector<?,?> v2)
Compute the angle between two vectors.
|
protected double |
angleSparse(SparseNumberVector<?,?> v1,
SparseNumberVector<?,?> v2)
Compute the angle for sparse vectors.
|
<T extends NumberVector<?,?>> |
instantiate(Relation<T> relation)
Instantiate with a database to get the actual distance query.
|
distance, getDistanceFactory, getInputTypeRestriction
isMetric, isSymmetric
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
doubleDistance
isMetric, isSymmetric
public AbstractCosineDistanceFunction()
protected double angle(NumberVector<?,?> v1, NumberVector<?,?> v2)
v1
- first vectorv2
- second vectorprotected double angleSparse(SparseNumberVector<?,?> v1, SparseNumberVector<?,?> v2)
v1
- First vectorv2
- Second vectorpublic <T extends NumberVector<?,?>> PrimitiveDistanceQuery<T,DoubleDistance> instantiate(Relation<T> relation)
AbstractPrimitiveDistanceFunction
instantiate
in interface DistanceFunction<NumberVector<?,?>,DoubleDistance>
instantiate
in class AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
relation
- Representation