public class PolynomialKernel extends BaseKernelTrick
Constructor and Description |
---|
PolynomialKernel(double degree)
Defaults alpha = 1 and c = 1
|
PolynomialKernel(double degree,
double alpha,
double c)
Creates a new polynomial kernel
|
Modifier and Type | Method and Description |
---|---|
PolynomialKernel |
clone() |
double |
eval(Vec a,
Vec b)
Evaluate this kernel function for the two given vectors.
|
double |
getAlpha()
Returns the scaling parameter
|
double |
getC()
Returns the additive constant
|
double |
getDegree()
Returns the degree of the polynomial
|
Parameter |
getParameter(String paramName)
Returns the parameter with the given name.
|
List<Parameter> |
getParameters()
Returns the list of parameters that can be altered for this learner.
|
static Distribution |
guessDegree(DataSet d)
Guesses the distribution to use for the degree parameter
|
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
|
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.
|
void |
setDegree(double d)
Sets the degree of the polynomial
|
String |
toString()
A descriptive name for the type of KernelFunction
|
addToCache, eval, eval, evalSum, evalSum, getAccelerationCache, getQueryInfo, normalized, supportsAcceleration
public PolynomialKernel(double degree, double alpha, double c)
degree
- the degree of the polynomialalpha
- the term to scale the dot product byc
- the additive termpublic PolynomialKernel(double degree)
degree
- the degree of the polynomialpublic void setAlpha(double alpha)
alpha
- the scaling factorpublic void setC(double c)
alpha
.c
- the non negative additive termpublic void setDegree(double d)
d
- the degree of the polynomialpublic double getAlpha()
public double getC()
public double getDegree()
public double eval(Vec a, Vec b)
KernelTrick
a
- the first vectorb
- the first vectorpublic String toString()
KernelTrick
toString
in interface KernelTrick
toString
in class Object
public static Distribution guessDegree(DataSet d)
d
- the dataset to get the guess forsetDegree(double)
public List<Parameter> getParameters()
Parameterized
public Parameter getParameter(String paramName)
Parameterized
paramName
- the name of the parameter to obtainpublic PolynomialKernel clone()
clone
in interface KernelTrick
clone
in class BaseKernelTrick
Copyright © 2017. All rights reserved.