I'm trying to create a boxplot with the distribution of RMSE over all predicted resamples. The mean of the resamples equals the models predicted RMSE and therefore it would be interesting to exhibit how this number is calculated. How can I obtain predicted RMSE if I had run each of the models resamples? For example with 5-fold CV:
- Model RMSE: 5
Fold 1, 2, 3, 4 ,5 = 5.02 , 5.01, 5, 4.99, 4.98
# Load packages
library(mlbench)
library(caret)
# Load data
data(BostonHousing)
#Dividing the data into train and test set
set.seed(1)
sample <- createDataPartition(BostonHousing$medv, p=0.75, list = FALSE)
train <- BostonHousing[sample,]
test <- BostonHousing[-sample,]
control <- trainControl(method='repeatedcv', number=10, repeats=3, savePredictions=TRUE)
metric <- 'RMSE'
# some random model
set.seed(1)
example <- train(medv~., data=train, method='example', metric=metric,
preProc=c('center', 'scale'), trControl=control)
I know one can obtain for this for resampled on train; example$resample
Is there some similar default way to this for predicted with each resample?
Appreciate all help, thanks.