Learn R Programming

NMF (version 0.20.6)

NMFstd-class: NMF Model - Standard model

Description

This class implements the standard model of Nonnegative Matrix Factorization. It provides a general structure and generic functions to manage factorizations that follow the standard NMF model, as defined by Lee et al. (2001).

Arguments

Details

Let $V$ be a $n \times m$ non-negative matrix and $r$ a positive integer. In its standard form (see references below), a NMF of $V$ is commonly defined as a pair of matrices $(W, H)$ such that:

$$V \equiv W H,$$

where:

  • $W$and$H$are$n \times r$and$r \times m$matrices respectively with non-negative entries;
  • $\equiv$is to be understood with respect to some loss function. Common choices of loss functions are based on Frobenius norm or Kullback-Leibler divergence.

Integer $r$ is called the factorization rank. Depending on the context of application of NMF, the columns of $W$ and $H$ are given different names: [object Object],[object Object],[object Object]

NMF approaches have been successfully applied to several fields. The package NMF was implemented trying to use names as generic as possible for objects and methods.

The following terminology is used: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

However, because the package NMF was primarily implemented to work with gene expression microarray data, it also provides a layer to easily and intuitively work with objects from the Bioconductor base framework. See bioc-NMF for more details.

References

Lee DD and Seung H (2001). "Algorithms for non-negative matrix factorization." _Advances in neural information processing systems_. .

See Also

Other NMF-model: initialize,NMFOffset-method, NMFns-class, NMFOffset-class

Examples

Run this code
# roxygen generated flag
options(R_CHECK_RUNNING_EXAMPLES_=TRUE)

# create a completely empty NMFstd object
new('NMFstd')

# create a NMF object based on one random matrix: the missing matrix is deduced
# Note this only works when using factory method NMF
n <- 50; r <- 3;
w <- rmatrix(n, r)
nmfModel(W=w)

# create a NMF object based on random (compatible) matrices
p <- 20
h <- rmatrix(r, p)
nmfModel(W=w, H=h)

# create a NMF object based on incompatible matrices: generate an error
h <- rmatrix(r+1, p)
try( new('NMFstd', W=w, H=h) )
try( nmfModel(w, h) )

# Giving target dimensions to the factory method allow for coping with dimension
# incompatibilty (a warning is thrown in such case)
nmfModel(r, W=w, H=h)

Run the code above in your browser using DataLab