public class KernelRidgeRegression extends Object implements Regressor, Parameterized
MultipleLinearRegression
with an added
L2 penalty for the weight vector. Modifier | Constructor and Description |
---|---|
|
KernelRidgeRegression()
Creates a new Kernel Ridge Regression learner that uses an RBF kernel
|
|
KernelRidgeRegression(double lambda,
KernelTrick kernel)
Creates a new Kernel Ridge Regression learner
|
protected |
KernelRidgeRegression(KernelRidgeRegression toCopy)
Copy Constructor
|
Modifier and Type | Method and Description |
---|---|
KernelRidgeRegression |
clone() |
KernelTrick |
getKernel()
Returns the kernel in use
|
double |
getLambda()
Returns the regularization constant in use
|
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 |
guessLambda(DataSet d)
Guesses the distribution to use for the λ parameter
|
double |
regress(DataPoint data) |
void |
setKernel(KernelTrick k)
Sets the kernel trick to use
|
void |
setLambda(double lambda)
Sets the regularization parameter used.
|
boolean |
supportsWeightedData() |
void |
train(RegressionDataSet dataSet) |
void |
train(RegressionDataSet dataSet,
ExecutorService threadPool) |
public KernelRidgeRegression()
public KernelRidgeRegression(double lambda, KernelTrick kernel)
lambda
- the regularization parameterkernel
- the kernel to usesetLambda(double)
protected KernelRidgeRegression(KernelRidgeRegression toCopy)
toCopy
- the object to copypublic static Distribution guessLambda(DataSet d)
d
- the dataset to get the guess forpublic void setLambda(double lambda)
lambda
- the positive regularization constant in (0, Inf)public double getLambda()
public void setKernel(KernelTrick k)
k
- the kernel to usepublic KernelTrick getKernel()
public void train(RegressionDataSet dataSet, ExecutorService threadPool)
public void train(RegressionDataSet dataSet)
public boolean supportsWeightedData()
supportsWeightedData
in interface Regressor
public KernelRidgeRegression clone()
public List<Parameter> getParameters()
Parameterized
getParameters
in interface Parameterized
public Parameter getParameter(String paramName)
Parameterized
getParameter
in interface Parameterized
paramName
- the name of the parameter to obtainCopyright © 2017. All rights reserved.