Learn R Programming

NMF (version 0.5.06)

NMFfitX1-class: Class to Store the Result from Multiple Runs of a NMF Algorithm when Only the Best Fit is Kept

Description

This class is used to return the result from a multiple run of a single NMF algorithm performed with function nmf with the -- default -- option keep.all=FALSE (cf. nmf).

It extends both classes NMFfitX and NMFfit, and stores a the result of the best fit in its NMFfit structure.

Beside the best fit, this class allows to hold data about the computation of the multiple runs, such as the number of runs, the CPU time used to perform all the runs, as well as the consensus matrix.

Due to the inheritance from class NMFfit, objects of class NMFfitX1 can be handled exactly as the results of single NMF run -- as if only the best run had been performed.

Arguments

Extends

Class "NMFfitX", directly. Class "NMFfit", directly. Class "NMF", by class "NMFfit", distance 2.

Validity

There is currently no validity check for this class.

See Also

NMFfitX , nmf-methods, nmf-multiple

Examples

Run this code
# 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