public class RidgeRegression extends Object implements Regressor, Parameterized
MultipleLinearRegression
with an added
L2 penalty for the weight vector. StochasticRidgeRegression
. For small data sets
that pose non-linear problems, you can also use KernelRidgeRegression
Modifier and Type | Class and Description |
---|---|
static class |
RidgeRegression.SolverMode
Sets which solver to use
|
Constructor and Description |
---|
RidgeRegression() |
RidgeRegression(double regularization) |
RidgeRegression(double regularization,
RidgeRegression.SolverMode mode) |
Modifier and Type | Method and Description |
---|---|
RidgeRegression |
clone() |
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.
|
RidgeRegression.SolverMode |
getSolverMode()
Returns the solver in use
|
double |
regress(DataPoint data) |
void |
setLambda(double lambda)
Sets the regularization parameter used.
|
void |
setSolverMode(RidgeRegression.SolverMode mode)
Sets which solver is to be used
|
boolean |
supportsWeightedData() |
void |
train(RegressionDataSet dataSet) |
void |
train(RegressionDataSet dataSet,
ExecutorService threadPool) |
public RidgeRegression()
public RidgeRegression(double regularization)
public RidgeRegression(double regularization, RidgeRegression.SolverMode mode)
public void setLambda(double lambda)
lambda
- the positive regularization constant in (0, Inf)public double getLambda()
public void setSolverMode(RidgeRegression.SolverMode mode)
mode
- the solver mode to usepublic RidgeRegression.SolverMode getSolverMode()
public void train(RegressionDataSet dataSet, ExecutorService threadPool)
public void train(RegressionDataSet dataSet)
public boolean supportsWeightedData()
supportsWeightedData
in interface Regressor
public RidgeRegression 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.