org.apache.spark.mllib.optimization

Class NNLS

• Object
• org.apache.spark.mllib.optimization.NNLS

• public class NNLS
extends Object
Object used to solve nonnegative least squares problems using a modified projected gradient method.
• Nested Class Summary

Nested Classes
Modifier and Type Class and Description
static class  NNLS.Workspace
• Constructor Summary

Constructors
Constructor and Description
NNLS()
• Method Summary

All Methods
Modifier and Type Method and Description
static NNLS.Workspace createWorkspace(int n)
static double[] solve(double[] ata, double[] atb, NNLS.Workspace ws)
Solve a least squares problem, possibly with nonnegativity constraints, by a modified projected gradient method.
• Methods inherited from class Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• Constructor Detail

• NNLS

public NNLS()
• Method Detail

• createWorkspace

public static NNLS.Workspace createWorkspace(int n)
• solve

public static double[] solve(double[] ata,
double[] atb,
NNLS.Workspace ws)
Solve a least squares problem, possibly with nonnegativity constraints, by a modified projected gradient method. That is, find x minimising ||Ax - b||_2 given A^T A and A^T b.

We solve the problem

\$\$ min_x 1/2 x^T ata x^T - x^T atb \$\$
where x is nonnegative.

The method used is similar to one described by Polyak (B. T. Polyak, The conjugate gradient method in extremal problems, Zh. Vychisl. Mat. Mat. Fiz. 9(4)(1969), pp. 94-112) for bound- constrained nonlinear programming. Polyak unconditionally uses a conjugate gradient direction, however, while this method only uses a conjugate gradient direction if the last iteration did not cause a previously-inactive constraint to become active.

Parameters:
ata - (undocumented)
atb - (undocumented)
ws - (undocumented)
Returns:
(undocumented)