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

setNMFMethod

Registering NMF Algorithms


Description

Adds a new algorithm to the registry of algorithms that perform Nonnegative Matrix Factorization.

nmfRegisterAlgorithm is an alias to setNMFMethod for backward compatibility.

Usage

setNMFMethod(name, method, ...,
    overwrite = isLoadingNamespace(), verbose = TRUE)

  nmfRegisterAlgorithm(name, method, ...,
    overwrite = isLoadingNamespace(), verbose = TRUE)

Arguments

...

arguments passed to the factory function NMFStrategy, which instantiate the NMFStrategy object that is stored in registry.

overwrite

logical that indicates if any existing NMF method with the same name should be overwritten (TRUE) or not (FALSE), in which case an error is thrown.

verbose

a logical that indicates if information about the registration should be printed (TRUE) or not (FALSE).

name

name/key of an NMF algorithm.

method

definition of the algorithm

Examples

# define/regsiter a new -- dummy -- NMF algorithm with the minimum arguments
# y: target matrix
# x: initial NMF model (i.e. the seed)
# NB: this algorithm simply return the seed unchanged
setNMFMethod('mynmf', function(y, x, ...){ x })

# check algorithm on toy data
res <- nmfCheck('mynmf')
# the NMF seed is not changed
stopifnot( nmf.equal(res, nmfCheck('mynmf', seed=res)) )

NMF

Algorithms and Framework for Nonnegative Matrix Factorization (NMF)

v0.23.0
GPL (>= 2)
Authors
Renaud Gaujoux, Cathal Seoighe
Initial release
2020-07-30

We don't support your browser anymore

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