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 ofAlternatingLeastSquaresMatrixFactorization
AlternatingLeastSquaresMatrixFactorization(Constraint wtConstraint, Constraint hConstraint, double tolerance, int maxIteration)
Creates an instance ofAlternatingLeastSquaresMatrixFactorization
-
Method Summary
Modifier and Type Method Description void
solve(org.ejml.data.DMatrixRMaj x, org.ejml.data.DMatrixRMaj w, org.ejml.data.DMatrixRMaj h)
Performs non-negative matrix regression with the upper limit constraintvoid
solve(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 ofConstraint
for matrix W^ThConstraint
- instance ofConstraint
for 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
-