Learn R Programming

NMF (version 0.5.06)

NMFfit-class: Base Class for to store Nonnegative Matrix Factorisation results

Description

Base class to handle the results of general Non-negative Matrix Factorisation algorithms (NMF).

It provides a general structure and generic functions to manage the results of NMF algorithms. It contains a slot with the fitted NMF model (see slot fit) as well as data about the methods and parameters used to compute the factorization.

Arguments

Extends

Class "NMF", directly.

Validity checks

The validity method for class NMFfit checks
  • slotfitcalling the suitable validity function on this object of classNMF(seeNMFfor more details).
  • the validity of slotobjectivethat must be either a function definition or anon-emptycharacter string.

Objects from the Class

Object of class NMFfit using the standard operator new.

However, there is usually no need to directly create such an object, as interface methods nmf and seed take care of it.

Details

The purpose of this class is to handle in a generic way the results of NMF algorithms. Its slot fit contains the fitted NMF model as an object of class NMF.

Other slots contains data about how the factorization has been computed, such as the algorithm and seeding method, the computation time, the final residuals, etc...Class NMFfit acts as a wrapper class for its slot fit. It inherits from interface class NMF defined for generic NMF models. Therefore, all the methods defined by this interface can be called directly on objects of class NMFfit. The calls are simply dispatched on slot fit, i.e. the results are the same as if calling the methods directly on slot fit.

See Also

Main interface to perform NMF in nmf-methods. Method seed to set NMF objects with values suitable to start algorithms with.

Examples

Run this code
# run default NMF algorithm on a random matrix
n <- 50; r <- 3; p <- 20
V <- matrix(runif(n*p), n, p)  
res <- nmf(V, r)							

# result class is NMFfit
class(res)

# show result
res

# compute summary measures
summary(res)

Run the code above in your browser using DataLab