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 (NMFStrategy)
`show`(object)

S4 (NMFStrategy)
`objective`(object)

S4 (NMFStrategy,character)
`objective`(object) <- value

S4 (NMFStrategy,function)
`objective`(object) <- value

is.mixed(object)

Arguments

object
Any R object
value
replacement value

Slots

  1. objectivethe 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.

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

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

Methods

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

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

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

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

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

  6. objectivesignature(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.

  7. objectivesignature(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.

  8. 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.

  9. 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.

  10. 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.

  11. 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.

  12. runsignature(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.

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