jsat.distributions.kernels
Class SigmoidKernel
- java.lang.Object
-
- jsat.distributions.kernels.BaseKernelTrick
-
- jsat.distributions.kernels.SigmoidKernel
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, KernelTrick, Parameterized
public class SigmoidKernel extends BaseKernelTrick
Provides an implementation of the Sigmoid (Hyperbolic Tangent) Kernel, which is of the form:
k(x, y) = tanh(alpha * < x, y > +c)
Technically, this kernel is not positive definite.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description SigmoidKernel(double alpha)Creates a new Sigmoid Kernel with a bias term of 1SigmoidKernel(double alpha, double C)Creates a new Sigmoid Kernel
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description SigmoidKernelclone()doubleeval(Vec a, Vec b)Evaluate this kernel function for the two given vectors.doublegetAlpha()Returns the scaling parameterdoublegetC()Returns the additive constantstatic DistributionguessAlpha(DataSet d)Guesses a distribution for the α parameterstatic DistributionguessC(DataSet d)Guesses a distribution for the α parametervoidsetAlpha(double alpha)Sets the scaling factor for the dot product, this is equivalent to multiplying each value in the data set by a constant factorvoidsetC(double c)Sets the additive term, when set to one this is equivalent to adding a bias term of 1 to each vector.-
Methods inherited from class jsat.distributions.kernels.BaseKernelTrick
addToCache, eval, eval, evalSum, evalSum, getAccelerationCache, getQueryInfo, normalized, supportsAcceleration
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsat.distributions.kernels.KernelTrick
toString
-
Methods inherited from interface jsat.parameters.Parameterized
getParameter, getParameters
-
-
-
-
Constructor Detail
-
SigmoidKernel
public SigmoidKernel(double alpha, double C)Creates a new Sigmoid Kernel- Parameters:
alpha- the scaling factor for the dot productC- the additive constant
-
SigmoidKernel
public SigmoidKernel(double alpha)
Creates a new Sigmoid Kernel with a bias term of 1- Parameters:
alpha- the scaling factor for the dot product
-
-
Method Detail
-
setAlpha
public void setAlpha(double alpha)
Sets the scaling factor for the dot product, this is equivalent to multiplying each value in the data set by a constant factor- Parameters:
alpha- the scaling factor
-
getAlpha
public double getAlpha()
Returns the scaling parameter- Returns:
- the scaling parameter
-
setC
public void setC(double c)
Sets the additive term, when set to one this is equivalent to adding a bias term of 1 to each vector. This is done after the scaling byalpha.- Parameters:
c- the non negative additive term
-
getC
public double getC()
Returns the additive constant- Returns:
- the additive constant
-
eval
public double eval(Vec a, Vec b)
Description copied from interface:KernelTrickEvaluate this kernel function for the two given vectors.- Parameters:
a- the first vectorb- the first vector- Returns:
- the evaluation
-
guessAlpha
public static Distribution guessAlpha(DataSet d)
Guesses a distribution for the α parameter- Parameters:
d- the data to get the guess for- Returns:
- a distribution for the α parameter
-
guessC
public static Distribution guessC(DataSet d)
Guesses a distribution for the α parameter- Parameters:
d- the data to get the guess for- Returns:
- a distribution for the α parameter
-
clone
public SigmoidKernel clone()
- Specified by:
clonein interfaceKernelTrick- Specified by:
clonein classBaseKernelTrick
-
-
DataMelt 3.0 © DataMelt by jWork.ORG