Skip to main content
. 2023 Feb 23;13(5):858. doi: 10.3390/diagnostics13050858
Algorithm 5: Algorithm for the k-fold cross validation
Input: D={d1,d2,.,dn}, class labels
Step1: Initialize i1,k5
Step2: Split D into k-folds
Step3: In iterationi, the ith fold is used for testing and the rest are used for training
Step4: ii+1
Step5: Repeat steps 3–4 while ik
Step6: Evaluate model on test score