Description Usage Arguments Functions Slots Methods (by generic) Examples
This class partially implements the generic interface defined for general
algorithms defined in the NMF package (see algorithmic-NMF).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## S4 method for signature 'NMFStrategy'
show(object)
## S4 method for signature 'NMFStrategy,mMatrix,NMFfit'
run(object, y, x, ...)
## S4 method for signature 'NMFStrategy,mMatrix,NMF'
run(object, y, x, ...)
## 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
## S4 method for signature 'NMFStrategy'
modelname(object)
is.mixed(object)
## S3 method for class 'NMFStrategy'
nmfFormals(x, ...)
|
y |
the target data that we want to approximate, passed as a matrix(-like) object. |
x |
an NMFfit object used as a starting point/seed by the algorithm. |
is.mixed: is.mixed tells if an NMF algorithm works on mixed-sign data.
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.
modela character string giving either the (sub)class name of the NMF-class instance used and returned by the strategy, or a function name.
mixeda logical that indicates if the algorithm works on mixed-sign data.
canFit:
canFit(x = NMFStrategy,y = character): Tells if an NMF algorithm can fit a given class of NMF models
canFit(x = NMFStrategy,y = NMF): Tells if an NMF algorithm can fit the same class of models as y
deviance:
deviance(object = NMFStrategy): Computes the value of the objective function between the estimate x
and the target y, using the objective function associated with the given
NMFStrategy object.
modelname:
modelname(object = NMFStrategy): Returns the model(s) that an NMF algorithm can fit.
nmfFormals:
nmfFormals(NMFStrategy): Returns the extra arguments that can be passed to an algorithm encapsulated in an NMFStrategy object.
Arguments that have default values defined by the strategy are set accordingly.
NMFStrategy:
NMFStrategy(name = character,method = NMFStrategy): Creates an NMFStrategy object based on a template object (Constructor-Copy).
NMFStrategy(name = NMFStrategy,method = missing): Creates an NMFStrategy based on a template object (Constructor-Copy),
in particular it uses the same name.
NMFStrategy(name = NULL,method = NMFStrategy): Creates an NMFStrategy based on a template object (Constructor-Copy)
but using a randomly generated name.
objective:
objective(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<-:
objective<-(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<-(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:
run(object = NMFStrategy,y = mMatrix,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(object = NMFStrategy,y = mMatrix,x = NMF): Method to run an NMF algorithm directly starting from a given NMF model.
1 2 3 4 | # get the type of model(s) associated with an NMF algorithm
modelname( nmfAlgorithm('brunet') )
modelname( nmfAlgorithm('nsNMF') )
modelname( nmfAlgorithm('offset') )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.