public class PolynomialKernelFunction extends AbstractVectorSimilarityFunction implements PrimitiveDistanceFunction<NumberVector>
Modifier and Type | Class and Description |
---|---|
static class |
PolynomialKernelFunction.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private double |
bias
Bias of the similarity function.
|
static int |
DEFAULT_DEGREE
The default degree.
|
private int |
degree
Degree of the polynomial kernel function.
|
Constructor and Description |
---|
PolynomialKernelFunction(int degree)
Constructor.
|
PolynomialKernelFunction(int degree,
double bias)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
distance(NumberVector fv1,
NumberVector fv2)
Computes the distance between two given DatabaseObjects according to this
distance function.
|
<T extends NumberVector> |
instantiate(Relation<T> database)
Instantiate with a database to get the actual distance query.
|
boolean |
isMetric()
Is this distance function metric (satisfy the triangle inequality)
|
boolean |
isSymmetric()
Is this function symmetric?
|
double |
similarity(NumberVector o1,
NumberVector o2)
Computes the similarity between two given DatabaseObjects according to this
similarity function.
|
getInputTypeRestriction
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInputTypeRestriction
isSquared
public static final int DEFAULT_DEGREE
private final int degree
private final double bias
public PolynomialKernelFunction(int degree, double bias)
degree
- Kernel degreebias
- Bias offsetpublic PolynomialKernelFunction(int degree)
degree
- Kernel degreepublic double similarity(NumberVector o1, NumberVector o2)
PrimitiveSimilarityFunction
similarity
in interface PrimitiveSimilarityFunction<NumberVector>
o1
- first DatabaseObjecto2
- second DatabaseObjectpublic boolean isSymmetric()
DistanceFunction
isSymmetric
in interface DistanceFunction<NumberVector>
isSymmetric
in interface SimilarityFunction<NumberVector>
true
when symmetricpublic boolean isMetric()
DistanceFunction
isMetric
in interface DistanceFunction<NumberVector>
true
when metric.public double distance(NumberVector fv1, NumberVector fv2)
PrimitiveDistanceFunction
distance
in interface PrimitiveDistanceFunction<NumberVector>
fv1
- first DatabaseObjectfv2
- second DatabaseObjectpublic <T extends NumberVector> DistanceSimilarityQuery<T> instantiate(Relation<T> database)
DistanceFunction
instantiate
in interface DistanceFunction<NumberVector>
instantiate
in interface PrimitiveDistanceFunction<NumberVector>
instantiate
in interface PrimitiveSimilarityFunction<NumberVector>
instantiate
in interface SimilarityFunction<NumberVector>
database
- The representation to useCopyright © 2019 ELKI Development Team. License information.