O
- vector typepublic class LinearKernelFunction<O extends NumberVector<?>> extends AbstractPrimitiveSimilarityFunction<O,DoubleDistance> implements PrimitiveDistanceFunction<O,DoubleDistance>
Constructor and Description |
---|
LinearKernelFunction()
Provides a linear Kernel function that computes a similarity between the
two vectors V1 and V2 defined by V1^T*V2.
|
Modifier and Type | Method and Description |
---|---|
DoubleDistance |
distance(O fv1,
O fv2)
Computes the distance between two given DatabaseObjects according to this
distance function.
|
DoubleDistance |
getDistanceFactory()
Method to get the distance functions factory.
|
VectorFieldTypeInformation<? super O> |
getInputTypeRestriction()
Get the input data type of the function.
|
<T extends O> |
instantiate(Relation<T> database)
Instantiate with a representation to get the actual similarity query.
|
boolean |
isMetric()
Is this distance function metric (in particular, does it satisfy the
triangle equation?)
|
DoubleDistance |
similarity(O o1,
O o2)
Provides a linear Kernel function that computes a similarity between the
two feature vectors V1 and V2 definded by V1^T*V2.
|
isSymmetric
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isSymmetric
public LinearKernelFunction()
public DoubleDistance similarity(O o1, O o2)
similarity
in interface PrimitiveSimilarityFunction<O extends NumberVector<?>,DoubleDistance>
similarity
in class AbstractPrimitiveSimilarityFunction<O extends NumberVector<?>,DoubleDistance>
o1
- first feature vectoro2
- second feature vectorDoubleDistance
.public DoubleDistance distance(O fv1, O fv2)
PrimitiveDistanceFunction
distance
in interface PrimitiveDistanceFunction<O extends NumberVector<?>,DoubleDistance>
fv1
- first DatabaseObjectfv2
- second DatabaseObjectpublic VectorFieldTypeInformation<? super O> getInputTypeRestriction()
SimilarityFunction
getInputTypeRestriction
in interface DistanceFunction<O extends NumberVector<?>,DoubleDistance>
getInputTypeRestriction
in interface PrimitiveDistanceFunction<O extends NumberVector<?>,DoubleDistance>
getInputTypeRestriction
in interface PrimitiveSimilarityFunction<O extends NumberVector<?>,DoubleDistance>
getInputTypeRestriction
in interface SimilarityFunction<O extends NumberVector<?>,DoubleDistance>
getInputTypeRestriction
in class AbstractPrimitiveSimilarityFunction<O extends NumberVector<?>,DoubleDistance>
public DoubleDistance getDistanceFactory()
DistanceFunction
getDistanceFactory
in interface DistanceFunction<O extends NumberVector<?>,DoubleDistance>
getDistanceFactory
in interface SimilarityFunction<O extends NumberVector<?>,DoubleDistance>
public boolean isMetric()
DistanceFunction
isMetric
in interface DistanceFunction<O extends NumberVector<?>,DoubleDistance>
true
when metric.public <T extends O> DistanceSimilarityQuery<T,DoubleDistance> instantiate(Relation<T> database)
SimilarityFunction
instantiate
in interface DistanceFunction<O extends NumberVector<?>,DoubleDistance>
instantiate
in interface SimilarityFunction<O extends NumberVector<?>,DoubleDistance>
instantiate
in class AbstractPrimitiveSimilarityFunction<O extends NumberVector<?>,DoubleDistance>
database
- Representation to use