cvReshape | R Documentation |
Reshape cross-validation results into an object of class "cvSelect"
with only one column of results.
cvReshape(x, ...)
## S3 method for class 'cv'
cvReshape(x, selectBest = c("min", "hastie"), seFactor = 1, ...)
## S3 method for class 'cvSelect'
cvReshape(x, selectBest = c("min", "hastie"), seFactor = 1, ...)
x |
an object inheriting from class |
... |
additional arguments to be passed down. |
selectBest |
a character string specifying a criterion for selecting
the best model. Possible values are |
seFactor |
a numeric value giving a multiplication factor of the
standard error for the selection of the best model. This is ignored if
|
An object of class "cvSelect"
with the following components:
n |
an integer giving the number of observations. |
K |
an integer giving the number of folds used in cross-validation. |
R |
an integer giving the number of replications used in cross-validation. |
best |
an integer giving the index of the model with the best prediction performance. |
cv |
a data frame containing the estimated prediction errors for the models. For repeated cross-validation, those are average values over all replications. |
se |
a data frame containing the estimated standard errors of the prediction loss for the models. |
selectBest |
a character string specifying the criterion used for selecting the best model. |
seFactor |
a numeric value giving the multiplication factor of the standard error used for the selection of the best model. |
reps |
a data frame containing the estimated prediction errors for the models from all replications. This is only returned if repeated cross-validation was performed. |
Andreas Alfons
Hastie, T., Tibshirani, R. and Friedman, J. (2009) The Elements of Statistical Learning: Data Mining, Inference, and Prediction. Springer, 2nd edition.
cvFit
, cvSelect
, cvTuning
library("robustbase")
data("coleman")
# perform cross-validation for an LTS regression model
fitLts <- ltsReg(Y ~ ., data = coleman)
cvFitLts <- cvLts(fitLts, cost = rtmspe, K = 5, R = 10,
fit = "both", trim = 0.1, seed = 1234)
# compare original and reshaped object
cvFitLts
cvReshape(cvFitLts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.