Estimating model performance with Leave One Out Cross Validation
We have already seen k-fold cross validation, Leave One Out Cross Validation (LOOCV) is a special case of k-fold cross validation where the number of folds is same as number of observation. In this case the set contains a single observation. It uses an entire model except the single point and later it is used to make a prediction. Once the prediction is made using the model, it is compared with the actual value.
Getting ready
In this recipe, we will continue to use the telecom churn
dataset as the input data source to perform Leave One Out Cross Validation. We will use the caret
and C50
package.
How to do it...
Perform the following steps:
- We need a
caret
andC50
library:
> install.packages("caret") > install.packages("C50") > library(caret) > library(C50)
- From the previous chapters, we have a
churn
dataset ready:
> train_control <- trainControl(method="LOOCV") The following...