cmf: Implementation notes for constrained matrix factorisation

View source: R/flame.R

cmfR Documentation

Implementation notes for constrained matrix factorisation

Description

cmf

Compute a low-rank matrix factorisation 3{ \min_{\mathbf A, \mathbf B} || (\mathbf X - \mathbf A \mathbf{B}^\top ) \circ \mathbf W ||_\mathrm F

min over A,B ||(X - A \%*\% t(B)) * W||_F <span style="font-style:normal;">min</span><sub><b>A</b>,<b>B</b></sub> ||(<b>X</b> - <b>A</b><b>B</b><sup><span style="font-style:normal;">T</span></sup>) &#x2218; <b>W</b>||<sub>F</sub> subject to weights 3{\mathbf WW<b>W</b> (set to 0 where 3{\mathbf X

Usage

  cmf(
    X, nfac = 1,
    const = list(list(const = "nonneg"), list(const = "nonneg")),
    start = c("svd", "random"), ctol = 1e-04, maxit = 10
  )
  ## S3 method for class 'cmf'
fitted(object, ...)
  wcmls(X, A, W, ..., struc = NULL)

Arguments

X

The matrix for a low-rank approximation.

nfac

The rank of the factorisation; the number of columns in matrices 3{\mathbf A, \mathbf B

A, B<b>A</b>, <b>B</b>.

Details

The CMLS package function cmls can solve constrained multivariate least squares problems of the form:

3{ \min_\mathbf{B} || \mathbf X - \mathbf A \mathbf B ||_\mathrm F = L(\mathbf X, \mathbf A, \mathbf B)

Value

cmf

An list of class cmf containing the 3{\mathbf A, \mathbf B

A, B<b>A</b>, <b>B</b> matrices.

wcmls

The 3{\mathbf B

B<b>B</b> matrix solving the constrained weighted multivariate least squares problem.

References

\reference

deJuan2014

See Also

cmls; the ALS package.

Examples

  data(feems)
  z <- feemscatter(feems$a, rep(25, 4), 'omit')
  str(zf <- albatross:::cmf(unclass(z)))
  str(albatross:::fitted.cmf(zf))

albatross documentation built on May 29, 2024, 9:10 a.m.