How to apply five-fold cross validation?

This code randomly splits out our data for validation by 20 percent but how could I change this so that I can randomly divide the training set into five-folds and use that as a validation set?

np.random.seed(42)
src = (ImageFileList.from_folder(path)            
       .label_from_csv('train_v2.csv', sep=' ', folder='train-jpg', suffix='.jpg')  
       .random_split_by_pct(0.2))

Here’s an example k-fold validation notebook here

1 Like

Notbook is not loading in Github. Is there a way I can open your notebook? thanks

Ok I can see it here