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 representation to get the actual similarity query.
|
boolean |
isMetric()
Is this distance function metric (in particular, does it satisfy the
triangle equation?)
|
double |
similarity(NumberVector o1,
NumberVector o2)
Computes the similarity between two given DatabaseObjects according to this
similarity function.
|
getInputTypeRestriction
isSymmetric
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInputTypeRestriction
isSymmetric
isSymmetric
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>
similarity
in class AbstractPrimitiveSimilarityFunction<NumberVector>
o1
- first DatabaseObjecto2
- second DatabaseObjectpublic 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)
SimilarityFunction
instantiate
in interface DistanceFunction<NumberVector>
instantiate
in interface SimilarityFunction<NumberVector>
instantiate
in class AbstractPrimitiveSimilarityFunction<NumberVector>
database
- Representation to useCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.