error for ei in range(len(features))select all but the one at position 'ei'training np ones(len(features)booltraining[eifalse testing ~training model learn_model(features[training]virginica[training]predictions apply_model(features[testing]virginica[testing]modelerror +np sum(predictions !virginica[testing]at the end of this loopwe will have tested series of models on all the examples howeverthere is no circularity problem because each example was tested on model that was built without taking the model into account thereforethe overall estimate is reliable estimate of how well the models would generalize the major problem with leave-one-out cross-validation is that we are now being forced to perform times more work in factwe must learn whole new model for each and every exampleand this will grow as our dataset grows we can get most of the benefits of leave-one-out at fraction of the cost by using -fold cross-validationhere"xstands for small numbersayfive in order to perform five-fold cross-validationwe break up the data in five groupsthat isfive folds then we learn five modelsleaving one fold out of each the resulting code will be similar to the code given earlier in this sectionbut here we leave percent of the data out instead of just one element we test each of these models on the left out fold and average the results