Learn R Programming

sglOptim (version 1.0.122.0)

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

object
an object
data
a data object
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):

  1. Withfita sgl fit object with models estimated usingxdata, the codeErr(fit, x)should return a vector with thetraining errorsof the models.
  2. Withx.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.
  3. Withfit.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).
  4. If subsampling is supported then, withfit.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).

See Also

compute_error