I'm reading an article about building a Random Forests algorithm which can predict which patients will respond to Immunotherapy (therapy named ICB) , based on collected data from the patients.
The scientists who conducted this research stratified the data randomly into 80% training set and 20% test set, and then they used 5-Fold cross validation on the training set.
I'll quote from the article so that it would be completely clear: "A random forest model was trained on multiple genomic, molecular, demographic and clinical features on the training data using five-fold cross-validation to predict ICB response, The resulting trained model with the best hyperparameters was evaluated using various performance metrics using the test set".
I'm very confused of how and why would they do the cross validation method over the training data and not the whole data ? how is it helpful for a random forest model ?
I really tried searching for an answer before coming here but found no helpful explanation. Thank you.