bignmf: Solving the nonnegative matrix factorization via alternating...

Description Usage Arguments Details Value Examples

Description

Solving the nonnegative matrix factorization via alternating least square.

Usage

1
bignmf(V, r, max.iteration = 200, stop.condition = 1e-04)

Arguments

V

the matrix to be factorized. Should be a numeric matrix.

r

the rank of resulting matrices.

max.iteration

the number of iterations allowed.

stop.condition

the function compares the norm of projected gradient matrix in the k-th iteration and the norm of gradient matrix after the first iteration. If the former one is less than the latter multiplying stop.condition, iteration stops .

Details

The nonnegative matrix factorization tries to find nonnegative matrices W and H, so that V \approx WH. Using sum of squares loss function, the problem is to solve \min_{W≥0, H≥0} f(V - WH). bignmf finds W minimizing f given H and then finds H give W, i.e. alternating least squares. The function treats nonnegative constrained regression as a special L1 regression and solves it via coordinate descent method.

Value

The function returns a list of length 3.

W

the resulting nonnegative matrix W.

H

the resulting nonnegative matrix H.

iterations

number of iterations.

Examples

1
2
3
4
5
6
## Not run: 
v_mat <- matrix(rexp(6000000,2), 2000, 3000)
system.time(re <- bignmf(v_mat, 20))
re$iterations

## End(Not run)

panlanfeng/bignmf documentation built on May 24, 2019, 6:14 p.m.