Class LARS_LassoCoeffVectorApproximator
- java.lang.Object
-
- edu.gsu.cs.dmlab.sparse.approximation.LARS_LassoCoeffVectorApproximator
-
- All Implemented Interfaces:
ISparseVectorApproximator
- Direct Known Subclasses:
LARS_LassoSparseMatrixApproximator
public class LARS_LassoCoeffVectorApproximator extends Object implements ISparseVectorApproximator
- Author:
- Dustin Kempton, Data Mining Lab, Georgia State University
-
-
Constructor Summary
Constructors Constructor Description LARS_LassoCoeffVectorApproximator(double lambda, LassoMode mode)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
solve(double[] b, smile.math.matrix.DenseMatrix A, double[] x)
Computes a sparse vector x, such that b = Ax using the LARS algorithm.void
solve(double[] b, smile.math.matrix.DenseMatrix A, smile.math.matrix.DenseMatrix AtA, double[] x)
Computes a sparse vector x, such that b = Ax using the LARS algorithm.
-
-
-
Constructor Detail
-
LARS_LassoCoeffVectorApproximator
public LARS_LassoCoeffVectorApproximator(double lambda, LassoMode mode)
Constructor- Parameters:
lambda
- Depending on mode, lambda is used differently. If mode 1, then lambda min amount of correlation between a coefficient in A and signal b for the algorithm to proceed. If mode 2, max L1 norm of the coefficient vector.mode
- What mode to use PENALTY or L1COEFF. See lambda for differences.
-
-
Method Detail
-
solve
public void solve(double[] b, smile.math.matrix.DenseMatrix A, double[] x) throws VectorDimensionMismatch, MatrixDimensionMismatch
Computes a sparse vector x, such that b = Ax using the LARS algorithm.- Specified by:
solve
in interfaceISparseVectorApproximator
- Parameters:
b
- vector on LHS of equation, which is assumed to have mean 0.A
- Matrix A to use in the solution, which is assumed to have had its columns normalized to have zero mean and unit l2 norm.x
- vector to compute and return- Throws:
VectorDimensionMismatch
- If there is some sort of internal error.MatrixDimensionMismatch
-
solve
public void solve(double[] b, smile.math.matrix.DenseMatrix A, smile.math.matrix.DenseMatrix AtA, double[] x) throws VectorDimensionMismatch, MatrixDimensionMismatch
Computes a sparse vector x, such that b = Ax using the LARS algorithm. Use this method when computing several vectors against the same matrix A to avoid computing AtA every method call.- Specified by:
solve
in interfaceISparseVectorApproximator
- Parameters:
b
- vector on LHS of equation, which is assumed to have mean 0.A
- Matrix A to use in the solution, which is assumed to have had its columns normalized to have zero mean and unit l2 norm.AtA
- The Gram Matrix of A used in the solution.x
- vector to compute and return- Throws:
VectorDimensionMismatch
- If there is some sort of internal error.MatrixDimensionMismatch
-
-