jml.regression
Class LASSO
java.lang.Object
jml.regression.Regression
jml.regression.LASSO
public class LASSO
- extends Regression
A Java implementation of LASSO, which solves the following
convex optimization problem:
min_W 2\1 || Y - X * W ||_F^2 + lambda * || W ||_1
where X is an n-by-p data matrix with each row bing a p
dimensional data vector and Y is an n-by-ny dependent
variable matrix.
- Version:
- 1.0 Jan. 14th, 2013
- Author:
- Mingjie Qian
Field Summary |
private boolean |
calc_OV
If compute objective function values during
the iterations or not. |
private double |
lambda
Regularization parameter. |
private boolean |
verbose
If show computation detail during iterations or not. |
Method Summary |
void |
loadModel(java.lang.String filePath)
|
static void |
main(java.lang.String[] args)
|
void |
saveModel(java.lang.String filePath)
|
void |
train()
Train the regression model. |
org.apache.commons.math.linear.RealMatrix |
train(org.apache.commons.math.linear.RealMatrix X,
org.apache.commons.math.linear.RealMatrix Y)
|
static org.apache.commons.math.linear.RealMatrix |
train(org.apache.commons.math.linear.RealMatrix X,
org.apache.commons.math.linear.RealMatrix Y,
Options options)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lambda
private double lambda
- Regularization parameter.
calc_OV
private boolean calc_OV
- If compute objective function values during
the iterations or not.
verbose
private boolean verbose
- If show computation detail during iterations or not.
LASSO
public LASSO()
LASSO
public LASSO(double epsilon)
LASSO
public LASSO(int maxIter,
double epsilon)
LASSO
public LASSO(double lambda,
int maxIter,
double epsilon)
LASSO
public LASSO(Options options)
main
public static void main(java.lang.String[] args)
- Parameters:
args
-
train
public void train()
- Description copied from class:
Regression
- Train the regression model.
- Specified by:
train
in class Regression
loadModel
public void loadModel(java.lang.String filePath)
- Specified by:
loadModel
in class Regression
saveModel
public void saveModel(java.lang.String filePath)
- Specified by:
saveModel
in class Regression
train
public static org.apache.commons.math.linear.RealMatrix train(org.apache.commons.math.linear.RealMatrix X,
org.apache.commons.math.linear.RealMatrix Y,
Options options)
train
public org.apache.commons.math.linear.RealMatrix train(org.apache.commons.math.linear.RealMatrix X,
org.apache.commons.math.linear.RealMatrix Y)
- Specified by:
train
in class Regression