Effective model evaluation is crucial for robust machine learning, and cross-validation techniques play a significant role. This study compares Repeated k-folds Cross Validation, k-folds Cross Validation, and Leave-One-Out Cross Validation (LOOCV) on imbalanced and balanced datasets across four models: Support Vector Machine (SVM), K-Nearest Neighbors (K-NN), Random Forest (RF), and Bagging, both with and without parameter tuning. On imbalanced data without parameter tuning, Repeated k-folds cross-validation demonstrated strong performance for SVM with a sensitivity of 0.541 and balanced accuracy of 0.764. K-folds Cross Validation showed a higher sensitivity of 0.784 for RF and a balanced accuracy of 0.884. In contrast, LOOCV achieved notable sensitivity for RF and Bagging at 0.787 and 0.784, respectively, but at the cost of lower precision and higher variance, as detailed in Table 1. When parameter tuning was applied to balanced data, the performance metrics improved. Sensitivity for SVM reached 0.893 with LOOCV and balanced accuracy for Bagging increased to 0.895. Stratified k-folds provided enhanced precision and F1-Score for SVM and RF. Notably, processing times varied significantly, with k-folds being the most efficient with SVM taking 21.480 seconds and Repeated k-folds showing higher computational demands where RF took approximately 1986.570 seconds in model processing, as shown in Table 4. This analysis underscores that while k-folds and repeated k-folds are generally efficient, LOOCV and balanced approaches offer enhanced accuracy for specific models but require greater computational resources. The choice of cross-validation technique should thus be tailored to the dataset characteristics and computational constraints to ensure optimal model evaluation.
Published in | American Journal of Theoretical and Applied Statistics (Volume 13, Issue 5) |
DOI | 10.11648/j.ajtas.20241305.13 |
Page(s) | 127-137 |
Creative Commons |
This is an Open Access article, distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution and reproduction in any medium or format, provided the original work is properly cited. |
Copyright |
Copyright © The Author(s), 2024. Published by Science Publishing Group |
Cross-Validation, Balanced Data, Imbalanced Data, Parameter Tuning, Hyperparameter Optimization
N | Mean | SD | Median | Mad | Min | Max | Range | Skew | Kurtosis | SE | |
---|---|---|---|---|---|---|---|---|---|---|---|
Q4 | 3280.000 | 0.731 | 0.444 | 1.000 | 0.000 | 0.000 | 1.000 | 1.000 | -1.040 | -0.918 | 0.008 |
Q5 | 3280.000 | 1.525 | 1.004 | 1.000 | 0.000 | 0.000 | 3.000 | 3.000 | 0.407 | -1.115 | 0.018 |
Q6 | 3280.000 | 1.538 | 1.356 | 1.000 | 1.483 | 0.000 | 7.000 | 7.000 | 0.953 | 1.228 | 0.024 |
Q7 | 3280.000 | 0.868 | 0.826 | 1.000 | 1.483 | 0.000 | 4.000 | 4.000 | 0.690 | 0.058 | 0.014 |
Q8 | 3280.000 | 3.179 | 0.895 | 3.000 | 1.483 | 1.000 | 4.000 | 3.000 | -0.555 | -1.059 | 0.016 |
Q9 | 3280.000 | 1.314 | 0.864 | 1.000 | 1.483 | 0.000 | 3.000 | 3.000 | 0.302 | -0.526 | 0.015 |
Q10 | 3280.000 | 0.703 | 0.780 | 1.000 | 0.000 | 0.000 | 3.000 | 3.000 | 1.412 | 2.296 | 0.014 |
Q11 | 3280.000 | 0.099 | 0.299 | 0.000 | 0.000 | 0.000 | 1.000 | 1.000 | 2.677 | 5.167 | 0.005 |
Q12 | 3280.000 | 0.096 | 0.295 | 0.000 | 0.000 | 0.000 | 1.000 | 1.000 | 2.741 | 5.514 | 0.005 |
Q13 | 3280.000 | 0.048 | 0.215 | 0.000 | 0.000 | 0.000 | 1.000 | 1.000 | 4.203 | 15.668 | 0.004 |
Feature | Definition | Feature | Definition |
---|---|---|---|
Q1 | Region | Q8 | Anaemic level |
Q2 | County | Q9 | The education level of the mother |
Q3 | Zones | Q10 | Type of mosquito net |
Q4 | Has Mosquito Net (Yes, No) | Q11 | Presence of Falciparum |
Q6 | Number of Children under five years slept under mosquito nets last night | Q12 | Presence of Malariae |
Q6 | Number of bed nets | Q13 | Presence of Ovalle |
Q7 | Number of children slept under mosquito nets |
Models Performance on the Testing Set | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Repeated K-folds Cross Validation | K-folds Cross Validation | Leave One Out Cross Validation | ||||||||||
SVM | K-NN | RF | Bagging | SVM | K-NN | RF | Bagging | SVM | K-NN | RF | Bagging | |
Sensitivity | 0.541 | 0.000 | 0.784 | 0.757 | 0.541 | 0.054 | 0.784 | 0.784 | 0.541 | 0.154 | 0.787 | 0.784 |
Specificity | 0.987 | 1.000 | 0.983 | 0.979 | 0.987 | 1.000 | 0.983 | 0.974 | 0.988 | 1.000 | 0.989 | 0.974 |
Precision | 0.625 | NA | 0.644 | 0.583 | 0.625 | 1.000 | 0.644 | 0.537 | 0.627 | 1.000 | 0.694 | 0.537 |
F1-Score | 0.580 | NA | 0.707 | 0.659 | 0.580 | 0.103 | 0.707 | 0.637 | 0.583 | 0.103 | 0.777 | 0.637 |
Balanced Accuracy | 0.764 | 0.500 | 0.884 | 0.868 | 0.764 | 0.527 | 0.884 | 0.879 | 0.768 | 0.524 | 0.894 | 0.879 |
Results from the Balanced Data with Tuned Parameters | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Repeated K-folds Cross Validation | K-folds Cross Validation | Leave One Out Cross Validation | ||||||||||
SVM | K-NN | RF | Bagging | SVM | K-NN | RF | Bagging | SVM | K-NN | RF | Bagging | |
Sensitivity | 0.784 | 0.703 | 0.784 | 0.784 | 0.378 | 0.609 | 0.811 | 0.784 | 0.893 | 0.740 | 0.829 | 0.844 |
Specificity | 0.973 | 0.979 | 0.977 | 0.977 | 0.981 | 0.981 | 0.977 | 0.973 | 0.988 | 0.999 | 0.993 | 0.987 |
Precision | 0.527 | 0.556 | 0.569 | 0.569 | 0.438 | 0.591 | 0.577 | 0.527 | 0.646 | 0.598 | 0.592 | 0.629 |
F1-Score | 0.630 | 0.610 | 0.659 | 0.659 | 0.406 | 0.642 | 0.674 | 0.630 | 0.718 | 0.669 | 0.693 | 0.697 |
Balanced Accuracy | 0.878 | 0.827 | 0.880 | 0.880 | 0.680 | 0.842 | 0.894 | 0.878 | 0.897 | 0.859 | 0.899 | 0.895 |
Processing Time (Seconds) | 532.110 | 21.480 | 1986.570 | 1786.570 | 100.560 | 5.970 | 0.884 | 0.879 | 987.540 | 65.652 | 2509.650 | 2476.540 |
KeNADA | Kenya National Data Archive |
K-NN | K-Nearest Neighbors |
LOOCV | Leave One Out Cross -Validation |
ML | Machine Learning |
RF | Random Forest |
SMOTE | Synthetic Minority Over-sampling Technique |
SVM | Support Vector Machines |
[1] | Wilimitis, D., & Walsh, C. G. (2023). Practical Considerations and Applied Examples of Cross-Validation for Model Development and Evaluation in Health Care: Tutorial. JMIR AI, 2(1), e49023. |
[2] | Browne, M. W. (2000). Cross-Validation Methods. Journal of Mathematical Psychology, 44(1), 108–132. |
[3] | Stone, M. (1974). Cross-Validatory Choice and Assessment of Statistical Predictions. Journal of the Royal Statistical Society: Series B (Methodological), 36(2), 111–133. |
[4] | Lachenbruch, P. A., & Mickey, M. R. (1968). Estimation of Error Rates in Discriminant Analysis. Technometrics, 10(1), 1–11. |
[5] | Bishnu, S. K., Alnouri, S. Y., & Mohannadi, A. (2023). Computational applications using data-driven modeling in process Systems: A review. Digital Chemical Engineering, 8, 100111–100111. |
[6] | Feurer, M., Klein, A., Eggensperger, K., Springenberg, J. T., Blum, M., & Hutter, F. (2019). Auto-sklearn: Efficient and Robust Automated Machine Learning. Automated Machine Learning, 113–134. |
[7] | Hastie, T., Tibshirani, R., & Friedman, J. (2009). The Elements of Statistical Learning. In Springer Series in Statistics. Springer New York. |
[8] | Berrar, D. (2019). Cross-Validation. Encyclopedia of Bioinformatics and Computational Biology, 1, 542–545. |
[9] | Wani, F. J., Rizvi, S. E. H., Sharma, M. K., & Bhat, M. I. J. (2018). A study on cross validation for model selection and estimation. INTERNATIONAL JOURNAL of AGRICULTURAL SCIENCES, 14(1), 165–172. |
[10] | James, G., Witten, D., Hastie, T., & Tibshirani, R. (2021). An Introduction to Statistical Learning. In Springer Texts in Statistics. Springer US. |
[11] | Kuhn, M., & Johnson, K. (2013). Applied Predictive Modeling. Springer New York. |
[12] | Schaffer, C. (1993). Selecting a Classification Method by Cross-Validation. Machine Learning, 13(1), 135–143. |
[13] | Leigh, W., Hightower, R., & Modani, N. (2005). Forecasting the New York stock exchange composite index with past price and interest rate on condition of volume spike. Expert Systems with Applications, 28(1), 1–8. |
[14] | Bergmeir, C., & Benítez, J. M. (2012). On the use of cross-validation for time series predictor evaluation. Information Sciences, 191, 192–213. |
[15] | Andoni, A., Naor, A., Nikolov, A., Ilya Razenshteyn, & Waingarten, E. (2018). Data-dependent hashing via nonlinear spectral gaps. |
[16] | Sugiyama, M., & Kawanabe, M. (2012). Machine learning in non-stationary environments : introduction to covariate shift adaptation. Mit Press. |
[17] | Yates, L. A., Aandahl, Z., Richards, S. A., & Brook, B. W. (2022). Cross-validation for model selection: a review with examples from ecology. Ecological Monographs, 93(1). |
[18] | Setia, M. S. (2019). Methodology series module 3: Cross-sectional studies. Indian Journal of Dermatology, 61(3), 261–264. NCBI. |
[19] | Shao, Z., & Er, M. J. (2016). Efficient Leave-One-Out Cross-Validation-based Regularized Extreme Learning Machine. Neurocomputing, 194, 260–270. |
[20] | Cha, G.-W., Moon, H. J., Kim, Y.-M., Hong, W.-H., Hwang, J.-H., Park, W.-J., & Kim, Y.-C. (2020). Development of a Prediction Model for Demolition Waste Generation Using a Random Forest Algorithm Based on Small DataSets. International Journal of Environmental Research and Public Health, 17(19), 6997. |
[21] | Jung, Y., & Hu, J. (2015). AK-foldss averaging cross-validation procedure. Journal of Nonparametric Statistics, 27(2), 167–179. |
[22] |
Ebner, J. (2023, December 27). Cross Validation, Explained - Sharp Sight. Sharp Sight.
https://www.sharpsightlabs.com/blog/cross-validation-explained/ |
[23] | Jung, Y. (2017). Multiple predictingK-foldss cross-validation for model selection. Journal of Nonparametric Statistics, 30(1), 197–215. |
[24] | Yadav, S., & Shukla, S. (2016). Analysis of K-foldss Cross-Validation over Hold-Out Validation on Colossal Datasets for Quality Classification. 2016 IEEE 6th International Conference on Advanced Computing (IACC), 78–83. |
[25] | Yang, L., & Shami, A. (2020). On hyperparameter optimization of machine learning algorithms: Theory and practice. Neurocomputing, 415, 295–316. |
[26] | Wu, J., Chen, X.-Y., Zhang, H., Xiong, L.-D., Lei, H., & Deng, S.-H. (2019). Hyperparameter Optimization for Machine Learning Models Based on Bayesian Optimization. Journal of Electronic Science and Technology, 17(1), 26–40. |
[27] | Muriithi, D., Lumumba, V., & Okongo, M. (2024). A Machine Learning-Based Prediction of Malaria Occurrence in Kenya. American Journal of Theoretical and Applied Statistics, 13(4), 65–72. |
[28] | Chapelle, O. (2007). Training a Support Vector Machine in the Primal. Neural Computation, 19(5), 1155–1178. |
APA Style
Lumumba, V. W., Kiprotich, D., Mpaine, M. L., Makena, N. G., Kavita, M. D. (2024). Comparative Analysis of Cross-Validation Techniques: LOOCV, K-folds Cross-Validation, and Repeated K-folds Cross-Validation in Machine Learning Models. American Journal of Theoretical and Applied Statistics, 13(5), 127-137. https://doi.org/10.11648/j.ajtas.20241305.13
ACS Style
Lumumba, V. W.; Kiprotich, D.; Mpaine, M. L.; Makena, N. G.; Kavita, M. D. Comparative Analysis of Cross-Validation Techniques: LOOCV, K-folds Cross-Validation, and Repeated K-folds Cross-Validation in Machine Learning Models. Am. J. Theor. Appl. Stat. 2024, 13(5), 127-137. doi: 10.11648/j.ajtas.20241305.13
AMA Style
Lumumba VW, Kiprotich D, Mpaine ML, Makena NG, Kavita MD. Comparative Analysis of Cross-Validation Techniques: LOOCV, K-folds Cross-Validation, and Repeated K-folds Cross-Validation in Machine Learning Models. Am J Theor Appl Stat. 2024;13(5):127-137. doi: 10.11648/j.ajtas.20241305.13
@article{10.11648/j.ajtas.20241305.13, author = {Victor Wandera Lumumba and Dennis Kiprotich and Mary Lemasulani Mpaine and Njoka Grace Makena and Musyimi Daniel Kavita}, title = {Comparative Analysis of Cross-Validation Techniques: LOOCV, K-folds Cross-Validation, and Repeated K-folds Cross-Validation in Machine Learning Models }, journal = {American Journal of Theoretical and Applied Statistics}, volume = {13}, number = {5}, pages = {127-137}, doi = {10.11648/j.ajtas.20241305.13}, url = {https://doi.org/10.11648/j.ajtas.20241305.13}, eprint = {https://article.sciencepublishinggroup.com/pdf/10.11648.j.ajtas.20241305.13}, abstract = {Effective model evaluation is crucial for robust machine learning, and cross-validation techniques play a significant role. This study compares Repeated k-folds Cross Validation, k-folds Cross Validation, and Leave-One-Out Cross Validation (LOOCV) on imbalanced and balanced datasets across four models: Support Vector Machine (SVM), K-Nearest Neighbors (K-NN), Random Forest (RF), and Bagging, both with and without parameter tuning. On imbalanced data without parameter tuning, Repeated k-folds cross-validation demonstrated strong performance for SVM with a sensitivity of 0.541 and balanced accuracy of 0.764. K-folds Cross Validation showed a higher sensitivity of 0.784 for RF and a balanced accuracy of 0.884. In contrast, LOOCV achieved notable sensitivity for RF and Bagging at 0.787 and 0.784, respectively, but at the cost of lower precision and higher variance, as detailed in Table 1. When parameter tuning was applied to balanced data, the performance metrics improved. Sensitivity for SVM reached 0.893 with LOOCV and balanced accuracy for Bagging increased to 0.895. Stratified k-folds provided enhanced precision and F1-Score for SVM and RF. Notably, processing times varied significantly, with k-folds being the most efficient with SVM taking 21.480 seconds and Repeated k-folds showing higher computational demands where RF took approximately 1986.570 seconds in model processing, as shown in Table 4. This analysis underscores that while k-folds and repeated k-folds are generally efficient, LOOCV and balanced approaches offer enhanced accuracy for specific models but require greater computational resources. The choice of cross-validation technique should thus be tailored to the dataset characteristics and computational constraints to ensure optimal model evaluation. }, year = {2024} }
TY - JOUR T1 - Comparative Analysis of Cross-Validation Techniques: LOOCV, K-folds Cross-Validation, and Repeated K-folds Cross-Validation in Machine Learning Models AU - Victor Wandera Lumumba AU - Dennis Kiprotich AU - Mary Lemasulani Mpaine AU - Njoka Grace Makena AU - Musyimi Daniel Kavita Y1 - 2024/10/10 PY - 2024 N1 - https://doi.org/10.11648/j.ajtas.20241305.13 DO - 10.11648/j.ajtas.20241305.13 T2 - American Journal of Theoretical and Applied Statistics JF - American Journal of Theoretical and Applied Statistics JO - American Journal of Theoretical and Applied Statistics SP - 127 EP - 137 PB - Science Publishing Group SN - 2326-9006 UR - https://doi.org/10.11648/j.ajtas.20241305.13 AB - Effective model evaluation is crucial for robust machine learning, and cross-validation techniques play a significant role. This study compares Repeated k-folds Cross Validation, k-folds Cross Validation, and Leave-One-Out Cross Validation (LOOCV) on imbalanced and balanced datasets across four models: Support Vector Machine (SVM), K-Nearest Neighbors (K-NN), Random Forest (RF), and Bagging, both with and without parameter tuning. On imbalanced data without parameter tuning, Repeated k-folds cross-validation demonstrated strong performance for SVM with a sensitivity of 0.541 and balanced accuracy of 0.764. K-folds Cross Validation showed a higher sensitivity of 0.784 for RF and a balanced accuracy of 0.884. In contrast, LOOCV achieved notable sensitivity for RF and Bagging at 0.787 and 0.784, respectively, but at the cost of lower precision and higher variance, as detailed in Table 1. When parameter tuning was applied to balanced data, the performance metrics improved. Sensitivity for SVM reached 0.893 with LOOCV and balanced accuracy for Bagging increased to 0.895. Stratified k-folds provided enhanced precision and F1-Score for SVM and RF. Notably, processing times varied significantly, with k-folds being the most efficient with SVM taking 21.480 seconds and Repeated k-folds showing higher computational demands where RF took approximately 1986.570 seconds in model processing, as shown in Table 4. This analysis underscores that while k-folds and repeated k-folds are generally efficient, LOOCV and balanced approaches offer enhanced accuracy for specific models but require greater computational resources. The choice of cross-validation technique should thus be tailored to the dataset characteristics and computational constraints to ensure optimal model evaluation. VL - 13 IS - 5 ER -