jsat.distributions.kernels
Class LinearKernel
- java.lang.Object
-
- jsat.distributions.kernels.BaseKernelTrick
-
- jsat.distributions.kernels.LinearKernel
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, KernelTrick, Parameterized
public class LinearKernel extends BaseKernelTrick
Provides a linear kernel function, which computes the normal dot product. k(x,y) = x.y + c- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description LinearKernel()Creates a new Linear Kernel with an added bias term of 1LinearKernel(double c)Creates a new Linear Kernel that computes the dot product and offsets it by a specified value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description LinearKernelclone()doubleeval(Vec a, Vec b)Evaluate this kernel function for the two given vectors.doublegetC()Returns the positive additive termvoidsetC(double c)The positive bias term added to the result of the dot productjava.lang.StringtoString()A descriptive name for the type of KernelFunction-
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, wait, wait, wait
-
Methods inherited from interface jsat.parameters.Parameterized
getParameter, getParameters
-
-
-
-
Constructor Detail
-
LinearKernel
public LinearKernel(double c)
Creates a new Linear Kernel that computes the dot product and offsets it by a specified value- Parameters:
c- the positive bias term for the dot product
-
LinearKernel
public LinearKernel()
Creates a new Linear Kernel with an added bias term of 1
-
-
Method Detail
-
setC
public void setC(double c)
The positive bias term added to the result of the dot product- Parameters:
c- the added product term
-
getC
public double getC()
Returns the positive additive term- Returns:
- the positive additive term
-
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
-
toString
public java.lang.String toString()
Description copied from interface:KernelTrickA descriptive name for the type of KernelFunction- Specified by:
toStringin interfaceKernelTrick- Overrides:
toStringin classjava.lang.Object- Returns:
- a descriptive name for the type of KernelFunction
-
clone
public LinearKernel clone()
- Specified by:
clonein interfaceKernelTrick- Specified by:
clonein classBaseKernelTrick
-
-
DataMelt 3.0 © DataMelt by jWork.ORG