Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

NMFStrategyFunction-class

Interface for Single Function NMF Strategies


Description

This class implements the virtual interface NMFStrategy for NMF algorithms that are implemented by a single workhorse R function.

Slots

algorithm

a function that implements an NMF algorithm. It must have signature (y='matrix', x='NMFfit'), where y is the target matrix to approximate and x is the NMF model assumed to be seeded with an appropriate initial value – as it is done internally by function nmf.

Note that argument names currently do not matter, but it is recommended to name them as specified above.

Methods

algorithm

signature(object = "NMFStrategyFunction"): Returns the single R function that implements the NMF algorithm – as stored in slot algorithm.

algorithm<-

signature(object = "NMFStrategyFunction", value = "function"): Sets the function that implements the NMF algorithm, stored in slot algorithm.

run

signature(object = "NMFStrategyFunction", y = "matrix", x = "NMFfit"): Runs the NMF algorithms implemented by the single R function – and stored in slot 'algorithm' of object, on the data object y, using x as starting point. It is equivalent to calling object@algorithm(y, x, ...).

This method is usually not called directly, but only via the function nmf, which takes care of many other details such as seeding the computation, handling RNG settings, or setting up parallelisation.


NMF

Algorithms and Framework for Nonnegative Matrix Factorization (NMF)

v0.23.0
GPL (>= 2)
Authors
Renaud Gaujoux, Cathal Seoighe
Initial release
2020-07-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.