Package elki.similarity.kernel
Class LinearKernel
- java.lang.Object
-
- elki.similarity.AbstractVectorSimilarity
-
- elki.similarity.kernel.PolynomialKernel
-
- elki.similarity.kernel.LinearKernel
-
- All Implemented Interfaces:
Distance<NumberVector>
,PrimitiveDistance<NumberVector>
,PrimitiveSimilarity<NumberVector>
,Similarity<NumberVector>
@Priority(200) public class LinearKernel extends PolynomialKernel
Linear Kernel function that computes a similarity between the two feature vectors x and y defined by \(x^T\cdot y\).Note: this is effectively equivalent to using
EuclideanDistance
- Since:
- 0.1
- Author:
- Simon Paradies
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LinearKernel.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description static LinearKernel
STATIC
Static instance.-
Fields inherited from class elki.similarity.kernel.PolynomialKernel
DEFAULT_DEGREE
-
-
Constructor Summary
Constructors Constructor Description LinearKernel()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(NumberVector fv1, NumberVector fv2)
Computes the distance between two given DatabaseObjects according to this distance function.double
similarity(NumberVector o1, NumberVector o2)
Computes the similarity between two given DatabaseObjects according to this similarity function.-
Methods inherited from class elki.similarity.kernel.PolynomialKernel
instantiate, isMetric, isSymmetric
-
Methods inherited from class elki.similarity.AbstractVectorSimilarity
getInputTypeRestriction
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.distance.PrimitiveDistance
getInputTypeRestriction
-
-
-
-
Field Detail
-
STATIC
public static final LinearKernel STATIC
Static instance.
-
-
Constructor Detail
-
LinearKernel
@Deprecated public LinearKernel()
Deprecated.Linear kernel. Use static instanceSTATIC
!
-
-
Method Detail
-
similarity
public double similarity(NumberVector o1, NumberVector o2)
Description copied from interface:PrimitiveSimilarity
Computes the similarity between two given DatabaseObjects according to this similarity function.- Specified by:
similarity
in interfacePrimitiveSimilarity<NumberVector>
- Overrides:
similarity
in classPolynomialKernel
- Parameters:
o1
- first DatabaseObjecto2
- second DatabaseObject- Returns:
- the similarity between two given DatabaseObjects according to this similarity function
-
distance
public double distance(NumberVector fv1, NumberVector fv2)
Description copied from interface:PrimitiveDistance
Computes the distance between two given DatabaseObjects according to this distance function.- Specified by:
distance
in interfacePrimitiveDistance<NumberVector>
- Overrides:
distance
in classPolynomialKernel
- Parameters:
fv1
- first DatabaseObjectfv2
- second DatabaseObject- Returns:
- the distance between two given DatabaseObjects according to this distance function
-
-