Class LinearKernel
java.lang.Object
com.imsl.datamining.supportvectormachine.Kernel
com.imsl.datamining.supportvectormachine.LinearKernel
- All Implemented Interfaces:
Cloneable
Specifies the linear kernel for support vector machines.
The kernel function at two data nodes, \(x_i\) and \(x_j\), is given by \(K(x_i , x_j) = x_i^Tx_j\).
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs aLinearKernelwith default parameters.LinearKernel(LinearKernel linKernel) Constructs a copy of the inputLinearKernelkernel. -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones aLinearKernelkernel.doublekernelFunction(DataNode[][] x, int i, int j) Calculates the kernel function between twoDataNodes.doublekernelFunction(DataNode[] x, DataNode[] y) Calculates the kernel function between twoDataNodes.Methods inherited from class com.imsl.datamining.supportvectormachine.Kernel
dot, getParameters, setParameters
-
Constructor Details
-
LinearKernel
public LinearKernel()Constructs aLinearKernelwith default parameters. -
LinearKernel
Constructs a copy of the inputLinearKernelkernel.- Parameters:
linKernel- aLinearKernelkernel
-
-
Method Details
-
clone
Clones aLinearKernelkernel. -
kernelFunction
Calculates the kernel function between twoDataNodes.- Specified by:
kernelFunctionin classKernel- Parameters:
x- aDataNodearrayy- aDataNodearray- Returns:
- a
double, the kernel function evaluated atxandy
-
kernelFunction
Calculates the kernel function between twoDataNodes.- Specified by:
kernelFunctionin classKernel- Parameters:
x- aDataNodematrixi- anint, index to the firstDataNode,x[i]j- anint, index to the secondDataNode,x[j]- Returns:
- a
double, the kernel function evaluated atx[i]andx[j]
-