<< Chapter < Page | Chapter >> Page > |
Optionally, step 3 in the algorithm may also be replaced with selecting the model according to , and then retraining on the entire training set . (This is often a good idea, with one exception being learning algorithms that are be very sensitive toperturbations of the initial conditions and/or data. For these methods, doing well on does not necessarily mean it will also do well on , and it might be better to forgo this retraining step.)
The disadvantage of using hold out cross validation is that it “wastes” about 30% of the data. Even if we were to take the optional step of retraining the model on theentire training set, it's still as if we're trying to find a good model for a learning problem in which we had training examples, rather than training examples, since we're testing models that were trained on only examples each time. While this is fine if data is abundant and/or cheap, in learning problems in which data is scarce (consider a problem with , say), we'd like to do something better.
Here is a method, called -fold cross validation , that holds out less data each time:
A typical choice for the number of folds to use here would be . While the fraction of data held out each time is now —much smaller than before—this procedure may also be more computationally expensive than hold-out crossvalidation, since we now need train to each model times.
While is a commonly used choice, in problems in which data is really scarce, sometimes we will use the extreme choice of in order to leave out as little data as possibleeach time. In this setting, we would repeatedly train on all but one of the training examples in , and test on that held-out example. The resulting errors are then averaged together to obtain our estimate of the generalization error of a model.This method has its own name; since we're holding out one training example at a time,this method is called leave-one-out cross validation.
Finally, even though we have described the different versions of cross validation as methods for selecting a model, they canalso be used more simply to evaluate a single model or algorithm. For example, if you have implemented some learningalgorithm and want to estimate how well it performs for your application (or if you have invented a novel learning algorithmand want to report in a technical paper how well it performs on various test sets), cross validation would give a reasonableway of doing so.
Notification Switch
Would you like to follow the 'Machine learning' conversation and receive update notifications?