Package org.dulab.javanmf.algorithms
Class AlternatingLeastSquaresMatrixFactorization
java.lang.Object
org.dulab.javanmf.algorithms.AlternatingLeastSquaresMatrixFactorization
public class AlternatingLeastSquaresMatrixFactorization
extends java.lang.Object
This class performs non-negative matrix factorization using the alternating non-negative least squares method.
See H. Kim and H. Park "NON-NEGATIVE MATRIX FACTORIZATION BASED ON ALTERNATING NON-NEGATIVITY CONSTRAINED LEAST SQUARES AND ACTIVE SET METHOD"
- Author:
- Du-Lab Team dulab.binf@gmail.com
-
Constructor Summary
Constructors Constructor Description AlternatingLeastSquaresMatrixFactorization(double tolerance, int maxIteration)Creates an instance ofAlternatingLeastSquaresMatrixFactorizationAlternatingLeastSquaresMatrixFactorization(Constraint wtConstraint, Constraint hConstraint, double tolerance, int maxIteration)Creates an instance ofAlternatingLeastSquaresMatrixFactorization -
Method Summary
Modifier and Type Method Description voidsolve(org.ejml.data.DMatrixRMaj x, org.ejml.data.DMatrixRMaj w, org.ejml.data.DMatrixRMaj h)Performs non-negative matrix regression with the upper limit constraintvoidsolve(org.ejml.data.DMatrixRMaj x, org.ejml.data.DMatrixRMaj w, org.ejml.data.DMatrixRMaj h, boolean verbose)Performs non-negative matrix regression with the upper limit constraint
-
Constructor Details
-
AlternatingLeastSquaresMatrixFactorization
public AlternatingLeastSquaresMatrixFactorization(@Nullable Constraint wtConstraint, @Nullable Constraint hConstraint, double tolerance, int maxIteration)Creates an instance ofAlternatingLeastSquaresMatrixFactorization- Parameters:
wtConstraint- instance ofConstraintfor matrix W^ThConstraint- instance ofConstraintfor matrix Htolerance- the fitting error tolerancemaxIteration- maximum number of iterations to use
-
AlternatingLeastSquaresMatrixFactorization
public AlternatingLeastSquaresMatrixFactorization(double tolerance, int maxIteration)Creates an instance ofAlternatingLeastSquaresMatrixFactorization- Parameters:
tolerance- the fitting error tolerancemaxIteration- maximum number of iterations to use
-
-
Method Details
-
solve
public void solve(@Nonnull org.ejml.data.DMatrixRMaj x, @Nonnull org.ejml.data.DMatrixRMaj w, @Nonnull org.ejml.data.DMatrixRMaj h, boolean verbose)Performs non-negative matrix regression with the upper limit constraint- Parameters:
x- matrix of shape [Npoints, Nvectors], a collection of vectors in Npoints-dimensional spacew- matrix of shape [Npoints, Ncomponents], a collection of componentsh- matrix of shape [Ncomponents, Nvectors], a collection of the decomposition coefficientsverbose- flag to output verbose information
-
solve
public void solve(@Nonnull org.ejml.data.DMatrixRMaj x, @Nonnull org.ejml.data.DMatrixRMaj w, @Nonnull org.ejml.data.DMatrixRMaj h)Performs non-negative matrix regression with the upper limit constraint- Parameters:
x- matrix of shape [Npoints, Nvectors], a collection of vectors in Npoints-dimensional spacew- matrix of shape [Npoints, Ncomponents], a collection of componentsh- matrix of shape [Ncomponents, Nvectors], a collection of the decomposition coefficients
-