Adds a new algorithm to the registry of algorithms that perform Nonnegative Matrix Factorization.
nmfRegisterAlgorithm
is an alias to setNMFMethod
for backward
compatibility.
setNMFMethod(name, method, ..., overwrite = isLoadingNamespace(), verbose = TRUE) nmfRegisterAlgorithm(name, method, ..., overwrite = isLoadingNamespace(), verbose = TRUE)
NMFStrategy
,
which instantiate the NMFStrategy-class
object that is stored
in registry.TRUE
) or not (FALSE
),
in which case an error is thrown.TRUE
) or not (FALSE
).
# 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 })
## Registering NMF algorithm 'mynmf' [NMFStrategyFunction] ... OK
# check algorithm on toy data
res <- nmfCheck('mynmf')
# the NMF seed is not changed
stopifnot( nmf.equal(res, nmfCheck('mynmf', seed=res)) )