Description Usage Arguments Value See Also Examples
View source: R/registry-algorithms.R
This function creates a wrapper function for calling the function nmf
with a given NMF algorithm.
1 | nmfWrapper(method, ..., .FIXED = FALSE)
|
method |
Name of the NMF algorithm to be wrapped.
It should be the name of a registered algorithm as returned by |
... |
extra named arguments that define default values for any arguments
of |
.FIXED |
a logical that indicates if the default arguments defined in
|
a function with argument ...
and a set of default arguments defined
in ...
in the call to nmfWrapper
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # wrap Lee & Seung algorithm into a function
lee <- nmfWrapper('lee', seed=12345)
args(lee)
# test on random data
x <- rmatrix(100,20)
res <- nmf(x, 3, 'lee', seed=12345)
res2 <- lee(x, 3)
nmf.equal(res, res2)
res3 <- lee(x, 3, seed=123)
nmf.equal(res, res3)
# argument 'method' has no effect
res4 <- lee(x, 3, method='brunet')
nmf.equal(res, res4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.