Cross validation code used to validate the accuracy of different models (Random Forest, Decision Tree, Adaboost, Naive Bayes). User can select the different folds that are required (default is set to 5 but this can be easily changed to 10)
The original intent of this cross validation code was to compare the different models and how they performed against one another. Confusion matrices were also created to look at the more granular details about how the models were performing. The cross validation code was written even though many packages include cross validation modules because it was difficult to ensure that each of the packages were performing the same type of cross validation.