# generate a synthetic dataset with known classes
n <- 50; counts <- c(5, 5, 8);
V <- syntheticNMF(n, counts, noise=TRUE)
# build the class factor
groups <- as.factor(do.call('c', lapply(seq(3), function(x) rep(x, counts[x]))))
# perform multiple runs of one algorithm, keeping only the best fit (default)
res <- nmf(V, 3, nrun=5)
res
#NOTE: the implicit nmf options are .options=list(keep.all=FALSE) or .options='-k'
# compute summary measures
summary(res)
# get more info
summary(res, target=V, class=groups)
# show computational time
runtime.all(res)
Run the code above in your browser using DataLab