public class PolynomialKernelFunction extends AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance> implements PrimitiveSimilarityFunction<NumberVector<?,?>,DoubleDistance>
Modifier and Type | Class and Description |
---|---|
static class |
PolynomialKernelFunction.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_DEGREE
The default degree.
|
private double |
degree
Degree of the polynomial kernel function
|
static OptionID |
DEGREE_ID
Degree parameter
|
Constructor and Description |
---|
PolynomialKernelFunction(double degree)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
DoubleDistance |
distance(NumberVector<?,?> fv1,
NumberVector<?,?> fv2)
Computes the distance between two given DatabaseObjects according to this
distance function.
|
DoubleDistance |
getDistanceFactory()
Method to get the distance functions factory.
|
VectorFieldTypeInformation<? super NumberVector<?,?>> |
getInputTypeRestriction()
Get the input data type of the function.
|
<T extends NumberVector<?,?>> |
instantiate(Relation<T> database)
Instantiate with a database to get the actual distance query.
|
DoubleDistance |
similarity(NumberVector<?,?> o1,
NumberVector<?,?> o2)
Provides the linear kernel similarity between the given two vectors.
|
isMetric, isSymmetric
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isSymmetric
public static final double DEFAULT_DEGREE
public static final OptionID DEGREE_ID
private double degree
public PolynomialKernelFunction(double degree)
degree
- Kernel degreepublic DoubleDistance similarity(NumberVector<?,?> o1, NumberVector<?,?> o2)
similarity
in interface PrimitiveSimilarityFunction<NumberVector<?,?>,DoubleDistance>
o1
- first vectoro2
- second vectorDoubleDistance
.public DoubleDistance distance(NumberVector<?,?> fv1, NumberVector<?,?> fv2)
PrimitiveDistanceFunction
distance
in interface PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
distance
in class AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
fv1
- first DatabaseObjectfv2
- second DatabaseObjectpublic VectorFieldTypeInformation<? super NumberVector<?,?>> getInputTypeRestriction()
SimilarityFunction
getInputTypeRestriction
in interface DistanceFunction<NumberVector<?,?>,DoubleDistance>
getInputTypeRestriction
in interface PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
getInputTypeRestriction
in interface PrimitiveSimilarityFunction<NumberVector<?,?>,DoubleDistance>
getInputTypeRestriction
in interface SimilarityFunction<NumberVector<?,?>,DoubleDistance>
public DoubleDistance getDistanceFactory()
DistanceFunction
getDistanceFactory
in interface DistanceFunction<NumberVector<?,?>,DoubleDistance>
getDistanceFactory
in interface SimilarityFunction<NumberVector<?,?>,DoubleDistance>
getDistanceFactory
in class AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
public <T extends NumberVector<?,?>> DistanceSimilarityQuery<T,DoubleDistance> instantiate(Relation<T> database)
AbstractPrimitiveDistanceFunction
instantiate
in interface DistanceFunction<NumberVector<?,?>,DoubleDistance>
instantiate
in interface SimilarityFunction<NumberVector<?,?>,DoubleDistance>
instantiate
in class AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
database
- Representation