Description Usage Arguments Value References Examples
Implementation of the updates for the LS-NMF algorithm from Wang et al. (2006).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | nmf_update.lsnmf(i, X, object, weight, eps = 10^-9, ...)
wrss(object, X, weight = 1, ...)
nmfAlgorithm._lsNMF(
...,
.stop = NULL,
maxIter = nmf.getOption("maxIter") %||% 2000,
weight,
eps = 10^-9,
stationary.th = .Machine$double.eps,
check.interval = 5 * check.niter,
check.niter = 10L
)
|
i |
current iteration |
X |
target matrix |
object |
current NMF model |
weight |
value for S, i.e. the weights that are applied to each
entry in Null weights can be used to handle missing values in the target matrix.
In particular, using |
eps |
small number passed to the standard euclidean-based NMF updates
(see |
... |
extra arguments (not used) |
.stop |
specification of a stopping criterion, that is used instead of the one associated to the NMF algorithm. It may be specified as:
|
maxIter |
maximum number of iterations to perform. |
stationary.th |
maximum absolute value of the gradient, for the objective function to be considered stationary. |
check.interval |
interval (in number of iterations) on which the stopping criterion is computed. |
check.niter |
number of successive iteration used to compute the stationnary criterion. |
updated object object
Wang G, Kossenkov AV, Ochs MF (2006). “LS-NMF: a modified non-negative matrix factorization algorithm utilizing uncertainty estimates.” _BMC bioinformatics_, *7*, 175. ISSN 1471-2105, doi: 10.1186/1471-2105-7-175 (URL: https://doi.org/10.1186/1471-2105-7-175).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # Handling missing values in data
x <- rmatrix(100, 20)
NA_values <- sample(length(x), 5)
x[ 1 ] <- NA
# Classic Lee does not work on this
try({
res <- nmf(x, 2, 'lee')
anyNA(res) # 3 means NA values in basis and coef matrix
})
# LS-NMF handles missing values by cancelling them with null weights
res <- nmf(x, 2, 'ls-nmf', .opt='v')
anyNA(res)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.