Class SigmoidKernel
java.lang.Object
com.imsl.datamining.supportvectormachine.Kernel
com.imsl.datamining.supportvectormachine.SigmoidKernel
- All Implemented Interfaces:
Serializable,Cloneable
Specifies the sigmoid 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) = \text{tanh}( \gamma x_i^T x_j + r)\) where \(\gamma\) and r are configurable parameters.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for the sigmoid kernel.SigmoidKernel(double gamma, double r) Constructs a sigmoid kernel.SigmoidKernel(SigmoidKernel sigmoidKernel) Constructs a copy of the inputSigmoidKernelkernel. -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones aSigmoidKernelkernel.doublekernelFunction(DataNode[][] x, int i, int j) Calculates the kernel function between twoDataNodes.doublekernelFunction(DataNode[] x, DataNode[] y) Calculates the kernel function between twoDataNodes.voidsetParameters(double... kParams) Sets the parameters for the sigmoid kernel.Methods inherited from class com.imsl.datamining.supportvectormachine.Kernel
dot, getParameters
-
Constructor Details
-
SigmoidKernel
public SigmoidKernel()Constructor for the sigmoid kernel.The default values for the sigmoid kernel are \(\gamma\)=1.0 and
r=0.0. -
SigmoidKernel
public SigmoidKernel(double gamma, double r) Constructs a sigmoid kernel.- Parameters:
gamma- adouble, the sigmoid kernel slope parameterr- adouble, the function intercept parameter
-
SigmoidKernel
Constructs a copy of the inputSigmoidKernelkernel.- Parameters:
sigmoidKernel- aSigmoidKernelkernel
-
-
Method Details
-
clone
Clones aSigmoidKernelkernel. -
setParameters
public void setParameters(double... kParams) Sets the parameters for the sigmoid kernel.- Overrides:
setParametersin classKernel- Parameters:
kParams- adoublearray of length 2 containing parameter values:kParams[0]=\(\gamma\) andkParams[1]=rDefault:
kParams[0]=\(\gamma\)=1.0 andkParams[1]=r=0
-
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]
-