Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

NNMF-class

Non-Negative Matrix Factorization


Description

S4 Class implementing NNMF.

Details

NNMF is a method for decomposing a matrix into a smaller dimension such that the constraint that the data (and the projection) are not negative is taken into account.

Slots

fun

A function that does the embedding and returns a dimRedResult object.

stdpars

The standard parameters for the function.

General usage

Dimensionality reduction methods are S4 Classes that either be used directly, in which case they have to be initialized and a full list with parameters has to be handed to the @fun() slot, or the method name be passed to the embed function and parameters can be given to the ..., in which case missing parameters will be replaced by the ones in the @stdpars.

Parameters

The method can take the following parameters:

ndim

The number of output dimensions.

method

character, which algorithm should be used. See nmf for possible values. Defaults to "brunet"

nrun

integer, the number of times the computations are conducted. See nmf

seed

integer, a value to control the random numbers used.

options

named list, other options to pass to nmf

Implementation

Wraps around nmf. Note that the estimation uses random numbers. To create reproducible results, set the random number seed in the function call. Also, in many cases, the computations will be conducted in parallel using multiple cores. To disable this, use the option .pbackend = NULL.

References

Lee, D.D., Seung, H.S., 1999. Learning the parts of objects by non-negative matrix factorization. Nature 401, 788-791. https://doi.org/10.1038/44565

See Also

Examples

dat <- loadDataSet("Iris")

set.seed(4646)
factorization <- embed(dat, "NNMF")

proj_dat <- factorization@apply(dat)

plot(proj_dat@data[, 1], proj_dat@data[, 2])

# project new values:

nn_proj <- predict(factorization, iris[1:7, 1:4])
nn_proj

dimRed

A Framework for Dimensionality Reduction

v0.2.3
GPL-3 | file LICENSE
Authors
Guido Kraemer [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.