Learn R Programming

NMF (version 0.2.2)

nmf-methods: Main Interface to run NMF algorithms

Description

This method implements the main interface to launch NMF algorithms within the framework defined in package NMF. It allows to combine NMF algorithms with seeding methods. The returned object can be directly passed to visualisation or comparison methods. For a tutorial on how to use the interface, please see the package's vignette: vignette('NMF')

Usage

## S3 method for class 'matrix,numeric,function':
nmf(x, rank, method, name, objective='euclidean', model='NMFstd', ...)
## S3 method for class 'matrix,numeric,character':
nmf(x, rank, method=nmf.getOption("default.algorithm"), ...)
## S3 method for class 'matrix,numeric,NMFStrategy':
nmf(x, rank, method, seed=nmf.getOption('default.seed'), nrun=1, model=list(), .options=list(), ...)

Arguments

method
The algorithm to use to perform NMF on x. Different formats are allowed: character, function. See section Methods for more details on how each format is used.
model
When method is a function, argument model must be a single character string or a list that specifies the NMF model to use. A NMF model is defined by a S4 class that extends class <
name
A character string to be used as a name for the custom NMF algorithm.
nrun
Used to perform multiple runs of the algorithm. It specifies the number of runs to perform . This argument is useful to achieve stability when using a random seeding method.
objective
Used when method is a function. It must be A character string giving the name of a built-in distance method or a function to be used as the objective function. It is used to compute the resid
.options
this argument is used to set some runtime options. It can be list containing the named options and their values, or, in the case only boolean options need to be set, a character string that specifies which options are turned on or
rank
The factorization rank to achieve [i.e a single positive numeric]
seed
The seeding method to use to compute the starting point passed to the algorithm. See section Seeding methods for more details on the possible classes and types for argument seed.
x
The target object to estimate. It can be a matrix, a data.frame, an ExpressionSet-class. See section Methods for more details.
...
Extra parameters passed to the NMF algorithm's run method. When there is no conflict with the slot names in the NMF model class, values for model slots can also be passed in .... See argument model.

Value

  • The returned value depends on the run mode:
  • Single run:An object that inherits from class NMF.
  • Multiple runs:When nrun > 1 or when method is a list, this method returns an object of class NMFSet

References

Lee, D.~D. and Seung, H.~S. (2000). Algorithms for non-negative matrix factorization. In NIPS, 556--562. Brunet, J.~P., Tamayo, P., Golub, T.~R., and Mesirov, J.~P. (2004). Metagenes and molecular pattern discovery using matrix factorization. Proc Natl Acad Sci U S A, 101(12), 4164--4169. Pascual-Montano, A., Carazo, J.~M., Kochi, K., Lehmann, D., and Pascual-Marqui, R.~D. (2006). Nonsmooth nonnegative matrix factorization (nsnmf). IEEE transactions on pattern analysis and machine intelligence, 8(3), 403--415. Kim, H. and Park, H. (2007). Sparse non-negative matrix factorizations via alternating non-negativity-constrained least squares for microarray data analysis. Bioinformatics. Liviu Badea (2008). Extracting Gene Expression Profiles Common To Colon And Pancreatic Adenocaricinoma Using Simultaneous Nonnegative Matrix Factorization. In Pacific Symposium on Biocomputing, 13, 279--290 S. Li, X. Hou, and H. Zhang (2001). Learning spatially localized, parts-based representation. In Proc. CVPR, 2001.

See Also

class NMF, NMF-utils, package's vignette

Examples

Run this code
# generate a synthetic dataset with known classes
n <- 100; counts <- c(10, 5, 8);
V <- syntheticNMF(n, counts, noise=TRUE)

# build the class factor
groups <- as.factor(do.call('c', lapply(seq(3), function(x) rep(x, counts[x]))))

# run default algorithm
res <- nmf(V, 3)
res
summary(res, class=groups)

# run nonsmooth NMF algorithm
res <- nmf(V, 3, 'nsNMF')
res
summary(res, class=groups)

# compare some NMF algorithms
res <- nmf(V, 3, list('brunet', 'lee', 'nsNMF'))
res
compare(res, class=groups)

# run on an ExpressionSet
data(esGolub)
nmf(esGolub, 3)

Run the code above in your browser using DataLab