public class RidgeRegression extends Object implements Regression<double[]>
Ridge regression is a kind of Tikhonov regularization, which is the most commonly used method of regularization of ill-posed problems. Another interpretation of ridge regression is available through Bayesian estimation. In this setting the belief that weight should be small is coded into a prior distribution.
Modifier and Type | Class and Description |
---|---|
static class |
RidgeRegression.Trainer
Trainer for ridge regression.
|
Constructor and Description |
---|
RidgeRegression(double[][] x,
double[] y,
double lambda)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double[] |
coefficients()
Returns the (scaled) linear coefficients.
|
double |
intercept()
Returns the (centered) intercept.
|
double |
predict(double[] x)
Predicts the dependent variable of an instance.
|
double |
shrinkage()
Returns the shrinkage parameter.
|
public RidgeRegression(double[][] x, double[] y, double lambda)
x
- a matrix containing the explanatory variables.y
- the response values.lambda
- the shrinkage/regularization parameter.public double[] coefficients()
public double intercept()
public double shrinkage()
public double predict(double[] x)
Regression
predict
in interface Regression<double[]>
x
- the instance.Copyright © 2015. All rights reserved.