Class Kernel
java.lang.Object
com.imsl.datamining.supportvectormachine.Kernel
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
LinearKernel,PolynomialKernel,RadialBasisKernel,SigmoidKernel
Abstract class to specify a kernel function for support vector machines.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedKernel(int numberOfParameters) Creates aKerneland specifies the number of kernel parameters for a specific Kernel. -
Method Summary
Modifier and TypeMethodDescriptionabstract Kernelclone()Returns a clone of this object.protected doubleCalculates the dot product between twoDataNodearrays.double[]Returns the kernel parameters.abstract doublekernelFunction(DataNode[][] x, int i, int j) Abstract method to calculate the kernel function between twoDataNodearrays.abstract doublekernelFunction(DataNode[] x, DataNode[] y) Abstract method to calculate the kernel function between twoDataNodearrays.voidsetParameters(double... kParams) Sets the kernel parameters.
-
Constructor Details
-
Kernel
protected Kernel(int numberOfParameters) Creates aKerneland specifies the number of kernel parameters for a specific Kernel.- Parameters:
numberOfParameters- anintindicating the number of parameters thisKernelmust have
-
-
Method Details
-
kernelFunction
Abstract method to calculate the kernel function between twoDataNodearrays.- Parameters:
x- aDataNodearrayy- aDataNodearray- Returns:
- a
double, the kernel function evaluated atxandy
-
kernelFunction
Abstract method to calculate the kernel function between twoDataNodearrays.- Parameters:
x- aDataNodematrixi- anint, the index of the firstDataNode,x[i]j- anint, the index of the secondDataNode,x[j]- Returns:
- a
double, the kernel function evaluated atx[i]andx[j]
-
clone
Returns a clone of this object. -
getParameters
public double[] getParameters()Returns the kernel parameters.- Returns:
- a
doublearray containing the kernel parameters
-
setParameters
public void setParameters(double... kParams) Sets the kernel parameters.Specific instances can override this method to test for proper values of the parameters.
- Parameters:
kParams- adoublearray containing the parameters
-
dot
Calculates the dot product between twoDataNodearrays. The array lengths may be different.- Parameters:
x- aDataNodearrayy- aDataNodearray- Returns:
- a
double, the dot product betweenxandy
-