Learn R Programming

perry (version 0.1.1)

perryReshape: Reshape resampling-based prediction error results

Description

Reshape resampling-based prediction error results into an object of class "perrySelect" with only one column of results.

Usage

perryReshape(x, selectBest = c("min", "hastie"),
    seFactor = 1, ...)

Arguments

x
an object inheriting from class "perry" or "perrySelect" that contains prediction error results.
selectBest
a character string specifying a criterion for selecting the best model. Possible values are "min" (the default) or "hastie". The former selects the model with the smallest prediction error. The latter is useful for nes
seFactor
a numeric value giving a multiplication factor of the standard error for the selection of the best model. This is ignored if selectBest is "min".
...
additional arguments to be passed down.

Value

  • An object of class "perrySelect" with the following components:
  • splitsan object giving the data splits used to estimate the prediction error.
  • bestan integer giving the index of the model with the best prediction performance.
  • pea data frame containing the estimated prediction errors for the models. In case of more than one resampling replication, those are average values over all replications.
  • sea data frame containing the estimated standard errors of the prediction loss for the models.
  • selectBesta character string specifying the criterion used for selecting the best model.
  • seFactora numeric value giving the multiplication factor of the standard error used for the selection of the best model.
  • repsa data frame containing the estimated prediction errors for the models from all replications. This is only returned in case of more than one resampling replication.

References

Hastie, T., Tibshirani, R. and Friedman, J. (2009) The Elements of Statistical Learning: Data Mining, Inference, and Prediction. Springer, 2nd edition.

See Also

perryFit, perrySelect, perryTuning

Examples

Run this code
data("coleman")

# perform cross-validation for an LTS regression model
fit <- ltsReg(Y ~ ., data = coleman)
cv <- repCV(fit, K = 5, R = 10, fit = "both", 
    cost = rtmspe, trim = 0.1, seed = 1234)

# compare original and reshaped object
cv
perryReshape(cv)

Run the code above in your browser using DataLab