public class CGRunner
extends java.lang.Object
Constructor and Description |
---|
CGRunner(LambdaSolve prob,
java.lang.String filename)
Set up a LambdaSolve problem for solution by a Minimizer.
|
CGRunner(LambdaSolve prob,
java.lang.String filename,
double priorSigmaS)
Set up a LambdaSolve problem for solution by a Minimizer,
specifying a value for sigma2.
|
CGRunner(LambdaSolve prob,
java.lang.String filename,
double tol,
double priorSigmaS)
Set up a LambdaSolve problem for solution by a Minimizer.
|
CGRunner(LambdaSolve prob,
java.lang.String filename,
double tol,
double[] sigmaSquareds)
Set up a LambdaSolve problem for solution by a Minimizer.
|
Modifier and Type | Method and Description |
---|---|
void |
solveCG()
Solves the problem using conjugate gradient (CG).
|
void |
solveL1(double weight)
Solves the problem using OWLQN.
|
void |
solveOWLQN2(double weight) |
void |
solveQN()
Solves the problem using a quasi-newton method (L-BFGS).
|
public CGRunner(LambdaSolve prob, java.lang.String filename)
prob
- The problem to solvefilename
- Used (with extension) to save intermediate results.public CGRunner(LambdaSolve prob, java.lang.String filename, double priorSigmaS)
prob
- The problem to solvefilename
- Used (with extension) to save intermediate results.priorSigmaS
- The prior sigma2: this doubled will be
used to divide the lambda2 values as the
prior penalty in the likelihood. A value of 0.0
or Double.POSITIVE_INFINITY
indicates to not use regularization.public CGRunner(LambdaSolve prob, java.lang.String filename, double tol, double priorSigmaS)
prob
- The problem to solvefilename
- Used (with extension) to save intermediate results.tol
- Tolerance of errors (passed to CG)priorSigmaS
- The prior sigma2: this doubled will be
used to divide the lambda2 values as the
prior penalty. A value of 0.0
or Double.POSITIVE_INFINITY
indicates to not use regularization.public CGRunner(LambdaSolve prob, java.lang.String filename, double tol, double[] sigmaSquareds)
prob
- The problem to solvefilename
- Used (with extension) to save intermediate results.tol
- Tolerance of errors (passed to CG)sigmaSquareds
- The prior sigma2 for each feature: this doubled will be
used to divide the lambda2 values as the
prior penalty. This array must have size the number of features.
If it is null, no regularization will be performed.public void solveQN()
lambda
array of prob
.public void solveOWLQN2(double weight)
public void solveCG()
lambda
array of prob
.public void solveL1(double weight)
lambda
array of prob
. Note that the
likelihood function will be a penalized L2 likelihood function unless you
have turned this off via setting the priorSigmaS to 0.0.weight
- Controls the sparseness/regularization of the L1 solution.
The bigger the number the sparser the solution. Weights between
0.01 and 1.0 typically give good performance.