Compute and returns an error rate for each model contained in x
.
See details for generic use cases.
Err(object, data, response, ...)
an object
a data object
a response object
additional parameters (optional)
a vector of length nmod(object)
or a matrix with nmod(object)
columns containing error rates for the models
The following generic use case should be supported (see for example msgl package for an implementation):
With fit
a sgl fit object with models estimated using x
data, the code
Err(fit, x)
should return a vector with the training errors of the models.
With x.new
a new data set with known responses response.new
, the code
Err(fit, x.new, response.new)
should return a vector with the errors of the models when applied to the new data set.
With fit.cv
a sgl cross validation object, the code
Err(fit.cv)
should return a vector with estimates of the expected generalization errors of the models (i.e. the cross validation errors).
If subsampling is supported then, with fit.sub
a sgl subsampling object, the code
Err(fit.sub)
should return a matrix with the test errors (each column corresponding to a model, i.e. rows corresponds to tests).
compute_error