Err: Generic function for computing error rates
Description
Compute and returns an error rate for each model
contained in x. See details for generic use cases.Usage
Err(object, data, response, ...)
Arguments
response
a response object
...
additional parameters (optional)
Value
- a vector of length
nmod(object) or a matrix with
nmod(object) columns containing error rates for
the models
Details
The following generic use case should be supported (see
for example msgl package for an implementation):
- With
fita sgl fit object with
models estimated usingxdata, the codeErr(fit, x)should return a vector with thetraining errorsof
the models. - With
x.newa new data set with known
responsesresponse.new, the codeErr(fit, x.new, response.new)should return a vector with the errors of the models when
applied to the new data set. - With
fit.cva
sgl cross validation object, the codeErr(fit.cv)should return a vector with estimates of theexpected generalization errorsof the models (i.e.
the cross validation errors). - If subsampling is supported then, with
fit.suba sgl subsampling object, the codeErr(fit.sub)should return a matrix with the test errors (each column
corresponding to a model, i.e. rows corresponds to
tests).