NMFStrategy-class: Virtual Interface for NMF Algorithms

NMFStrategy-classR Documentation

Virtual Interface for NMF Algorithms

Description

This class partially implements the generic interface defined for general algorithms defined in the NMF package (see algorithmic-NMF).

is.mixed tells if an NMF algorithm works on mixed-sign data.

Usage

  ## S4 method for signature 'NMFStrategy'
show(object)

  ## S4 method for signature 'NMFStrategy'
objective(object)

  ## S4 replacement method for signature 'NMFStrategy,character'
objective(object)<-value

  ## S4 replacement method for signature 'NMFStrategy,function'
objective(object)<-value

  is.mixed(object)

Arguments

object

Any R object

value

replacement value

Slots

objective

the objective function associated with the algorithm (Frobenius, Kullback-Leibler, etc...). It is either an access key of a registered objective function or a function definition. In the latter case, the given function must have the following signature (x="NMF", y="matrix") and return a nonnegative real value.

model

a character string giving either the (sub)class name of the NMF-class instance used and returned by the strategy, or a function name.

mixed

a logical that indicates if the algorithm works on mixed-sign data.

Methods

canFit

signature(x = "NMFStrategy", y = "character"): Tells if an NMF algorithm can fit a given class of NMF models

canFit

signature(x = "NMFStrategy", y = "NMF"): Tells if an NMF algorithm can fit the same class of models as y

deviance

signature(object = "NMFStrategy"): Computes the value of the objective function between the estimate x and the target y.

modelname

signature(object = "NMFStrategy"): Returns the model(s) that an NMF algorithm can fit.

NMFStrategy

signature(name = "NMFStrategy", method = "missing"): Creates an NMFStrategy based on a template object (Constructor-Copy), in particular it uses the same name.

objective

signature(object = "NMFStrategy"): Gets the objective function associated with an NMF algorithm.

It is used in deviance to compute the objective value for an NMF model with respect to a given target matrix.

objective

signature(object = "NMFStrategy"): Gets the objective function associated with an NMF algorithm.

It is used in deviance to compute the objective value for an NMF model with respect to a given target matrix.

objective<-

signature(object = "NMFStrategy", value = "character"): Sets the objective function associated with an NMF algorithm, with a character string that must be a registered objective function.

objective<-

signature(object = "NMFStrategy", value = "character"): Sets the objective function associated with an NMF algorithm, with a character string that must be a registered objective function.

objective<-

signature(object = "NMFStrategy", value = "function"): Sets the objective function associated with an NMF algorithm, with a function that computes the approximation error between an NMF model and a target matrix.

objective<-

signature(object = "NMFStrategy", value = "function"): Sets the objective function associated with an NMF algorithm, with a function that computes the approximation error between an NMF model and a target matrix.

run

signature(object = "NMFStrategy", y = "matrix", x = "NMFfit"): Pure virtual method defined for all NMF algorithms to ensure that a method run is defined by sub-classes of NMFStrategy.

It throws an error if called directly.

run

signature(object = "NMFStrategy", y = "matrix", x = "NMF"): Method to run an NMF algorithm directly starting from a given NMF model.


NMF documentation built on Sept. 11, 2024, 8:34 p.m.