Description Usage Arguments Examples
View source: R/registry-algorithms.R
Adds a new algorithm to the registry of algorithms that perform Nonnegative Matrix Factorization.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | setNMFMethod(
name,
method,
...,
overwrite = isLoadingNamespace(),
verbose = TRUE
)
nmfRegisterAlgorithm(
name,
method,
...,
overwrite = isLoadingNamespace(),
verbose = TRUE
)
|
name |
name/key of an NMF algorithm. |
method |
definition of the algorithm |
... |
arguments passed to the factory function |
overwrite |
logical that indicates if any existing NMF method with the
same name should be overwritten ( |
verbose |
a logical that indicates if information about the registration
should be printed ( |
1 2 3 4 5 6 7 8 9 10 | # 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)) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.