The package NMF defines methods for the function residuals
that returns the final residuals of an NMF fit or the track of the residuals
along the fit process, computed according to the objective function
associated with the algorithm that fitted the model.
residuals<-
sets the value of the last residuals, or, optionally,
of the complete residual track.
Tells if an NMFfit
object contains a recorded residual track.
trackError
adds a residual value to the track of residuals.
residuals(object, ...) S4 (NMFfit) `residuals`(object, track = FALSE, niter = NULL, ...) residuals(object, ...) <- value S4 (NMFfit) `residuals`(object, ..., niter = NULL, track = FALSE) <- value hasTrack(object, niter = NULL) trackError(object, value, niter, force = FALSE)
NMFfit
object as fitted by function nmf
,
in single run mode.NULL
nmf.getOption('track.interval')
.residuals
returns a single numeric value if track=FALSE
or a numeric vector containing the residual values at some iterations.
The names correspond to the iterations at which the residuals were computed.
When called with track=TRUE
, the whole residuals track is returned,
if available.
Note that method nmf
does not compute the residuals track,
unless explicitly required.
It is a S4 methods defined for the associated generic functions from package
stats
(See residuals).
Stricly speaking, the method residuals,NMFfit
does not fulfill
its contract as defined by the package stats
, but rather acts as function
deviance
.
The might be changed in a later release to make it behave as it should.
signature(object = "NMFfit")
: Returns the residuals -- track -- between the target matrix and the NMF
fit object
.
signature(object = "NMFfitX")
: Returns the residuals achieved by the best fit object, i.e. the lowest
residual approximation error achieved across all NMF runs.