public abstract class LSMSolver extends Iced
Modifier and Type | Class and Description |
---|---|
static class |
LSMSolver.ADMMSolver |
static class |
LSMSolver.LSMSolverException |
static class |
LSMSolver.LSMSolverType |
static class |
LSMSolver.ProxSolver |
Modifier and Type | Field and Description |
---|---|
protected boolean |
_converged |
java.lang.String |
_id |
Key |
_jobKey |
Constructor and Description |
---|
LSMSolver(double lambda,
double alpha) |
Modifier and Type | Method and Description |
---|---|
boolean |
converged() |
double[] |
grad(Gram gram,
double[] beta,
double[] xy) |
protected double |
lsm_objectiveVal(double[] xy,
double yy,
double[] beta,
double[] xb)
Compute the LSM objective.
|
abstract java.lang.String |
name() |
protected double |
objectiveVal(double[] xy,
double yy,
double[] beta,
double[] xb)
Compute least squares objective function value:
lsm_obj(beta) = 0.5*(y - X*b)'*(y - X*b) + l1 + l2
= 0.5*y'y - (X'y)'*b + 0.5*b'*X'X*b) + l1 + l2
l1 = alpha*lambda*l1norm(beta)
l2 = (1-alpha)*lambda*l2norm(beta)/2
|
protected static double |
shrinkage(double x,
double kappa) |
abstract boolean |
solve(Gram gram,
double[] xy,
double yy,
double[] newBeta) |
static void |
subgrad(double alpha,
double lambda,
double[] beta,
double[] grad) |
clone, frozenType, init, newInstance, read, toDocField, write, writeJSON, writeJSONFields
public Key _jobKey
public java.lang.String _id
protected boolean _converged
public final double[] grad(Gram gram, double[] beta, double[] xy)
public static void subgrad(double alpha, double lambda, double[] beta, double[] grad)
public abstract boolean solve(Gram gram, double[] xy, double yy, double[] newBeta)
xy
- - guassian: -X'y binomial: -(1/4)X'(XB + (y-p)/(p*1-p))yy
- - < y,y > /2newBeta
- - resulting vector of coefficientspublic final boolean converged()
public abstract java.lang.String name()
protected static double shrinkage(double x, double kappa)
protected double objectiveVal(double[] xy, double yy, double[] beta, double[] xb)
xy:
- X'yyy:
- 0.5*y'ybeta:
- b (vector of coefficients)xb:
- X'X*betaprotected double lsm_objectiveVal(double[] xy, double yy, double[] beta, double[] xb)
xy
- X'yyy
- y'ybeta
- xb
- X'X*beta