Perbandingan Grid Search dan Random Search untuk Optimasi Hyperparameter Random Forest pada Klasifikasi Kanker Payudara
DOI:
https://doi.org/10.47065/bulletincsr.v6i4.1087Keywords:
Random Forest; Grid Search; Random Search; Hyperparameter Optimization; Breast Cancer ClassificationAbstract
Breast cancer is the most prevalent type of cancer in Indonesia, with 71% of patients diagnosed at advanced stages due to limited access to early detection. This condition necessitates the development of machine learning-based screening systems that are not only accurate but also computationally efficient to enable widespread implementation in healthcare facilities with limited resources, making the selection of an efficient hyperparameter optimization method crucial. This study compares two hyperparameter optimization methods, namely Grid Search and Random Search, applied to the Random Forest algorithm using the UCI Wisconsin Diagnostic Breast Cancer Dataset (569 samples, 30 numerical features) with an identical search space encompassing 288 hyperparameter combinations and stratified 5-fold cross-validation. Experimental results demonstrate that Random Search RF achieves performance equivalent to Baseline RF on threshold-based metrics (accuracy 0.9737; F1-Score 0.9630) while producing the highest AUC-ROC of 0.9950 in 88,26 seconds. In contrast, Grid Search RF yields performance below the baseline (accuracy 0.9561; F1-Score 0.9367) with a computation time of 526,73 seconds, attributable to the optimizer's curse phenomenon in which the selected combination based on cross-validation does not produce optimal generalization on the test data. Random Search is proven to be 5.97 times more efficient than Grid Search with superior solution quality, empirically confirming the theoretical proposition that Random Search is capable of finding competitive configurations at substantially lower computational cost compared to exhaustive search in high-dimensional hyperparameter spaces.
Downloads
References
F. Bray et al., “Global cancer statistics 2022: GLOBOCAN estimates of incidence and mortality worldwide for 36 cancers in 185 countries,” CA Cancer J. Clin., vol. 74, no. 3, pp. 229–263, 2024, doi: 10.3322/caac.21834.
J. Ferlay et al., “Global Cancer Observatory: Cancer Today — Indonesia Fact Sheet (GLOBOCAN 2022),” International Agency for Research on Cancer (IARC). Accessed: Mar. 09, 2026. [Online]. Available: https://gco.iarc.who.int/media/globocan/factsheets/populations/360-indonesia-fact-sheet.pdf
I. B. Setyawan et al., “Sociodemographic disparities associated with advanced stages and distant metastatic breast cancers at diagnosis in Indonesia: a cross-sectional study,” Annals of Medicine & Surgery, vol. 85, no. 9, pp. 4211–4217, 2023, doi: 10.1097/ms9.0000000000001030.
K. Lemons and I. W. Rathnathungalage, “A Comparison Between Naïve Bayes and Random Forest to Predict Breast Cancer,” International Journal of Undergraduate Research and Creative Activities, vol. 12, no. 1, p. 1, 2023, doi: 10.7710/2168-0620.0287.
A. Batool and Y. C. Byun, “Breast Cancer Classification using Random Forest Algorithm,” in Journal of Physics: Conference Series, 2023. doi: 10.1088/1742-6596/2559/1/012002.
L. Breiman, “Random Forests,” Mach. Learn., vol. 45, no. 1, pp. 5–32, 2001, doi: 10.1023/A:1010933404324.
Md. M. Rahman, A. Rahman, S. Akter, and S. A. Pinky, “Hyperparameter Tuning Based Machine Learning Classifier for Breast Cancer Prediction,” Journal of Computer and Communications, vol. 11, no. 04, pp. 149–165, 2023, doi: 10.4236/jcc.2023.114007.
P. Jain, S. Aggarwal, S. Adam, and M. Imam, “Parametric optimization and comparative study of machine learning and deep learning algorithms for breast cancer diagnosis,” Breast Dis., vol. 43, no. 1, pp. 257–270, 2024, doi: 10.3233/BD-240018.
M. Sholeh, U. Lestari, and D. Andayati, “Hyperparameter Optimization Using Grid Search and Random Search to Improve the Performance of Prediction Models with Decision Trees,” Jurnal Riset Multidisiplin dan Inovasi Teknologi, vol. 3, no. 03, pp. 453–464, 2025, doi: 10.59653/jimat.v3i03.2025.
J. Bergstra and Y. Bengio, “Random search for hyper-parameter optimization,” Journal of Machine Learning Research, vol. 13, pp. 281–305, 2012.
W. Wolberg, O. Mangasarian, N. Street, and W. Street, “Breast Cancer Wisconsin (Diagnostic),” UCI Machine Learning Repository. Accessed: Apr. 08, 2026. [Online]. Available: https://doi.org/10.24432/C5DW2B
W. N. Street, W. H. Wolberg, and O. L. Mangasarian, “Nuclear feature extraction for breast tumor diagnosis,” IS&T/SPIE 1993 International Symposium on Electronic Imaging: Science and Technology, vol. 1905, no. 870, pp. 861–870, 1993, doi: 10.1117/12.148698.
A. Géron, Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow Concepts, Tools, and Techniques to Build Intelligent Systems, 3rd ed. United States of America: O’Reilly Media, 2022.
Q. A. Hidayaturrohman and E. Hanada, “A Comparative Analysis of Hyper-Parameter Optimization Methods for Predicting Heart Failure Outcomes,” Applied Sciences (Switzerland), vol. 15, no. 6, p. 3393, 2025, doi: 10.3390/app15063393.
M. Quintana et al., “It is not always greener on the other side: Greenery perception across demographics and personalities in multiple cities,” Landsc. Urban Plan., vol. 271, p. 105618, 2026, doi: 10.1016/j.landurbplan.2026.105618.
F. Pedregosa et al., “Scikit-learn: Machine Learning in Python,” Journal of Machine Learning Research, vol. 12, pp. 2825–2830, 2011, [Online]. Available: https://www.jmlr.org/papers/volume12/pedregosa11a/pedregosa11a.pdf
S. Kapoor and A. Narayanan, “Leakage and the reproducibility crisis in machine-learning-based science,” Patterns, vol. 4, no. 9, p. 100804, 2023, doi: 10.1016/j.patter.2023.100804.
Y. A. Ali, E. M. Awwad, M. Al-Razgan, and A. Maarouf, “Hyperparameter Search for Machine Learning Algorithms for Optimizing the Computational Complexity,” Processes, vol. 11, no. 2, p. 349, 2023, doi: 10.3390/pr11020349.
scikit-learn developers, “GridSearchCV — scikit-learn 1.9.0 documentation.” 2026. [Online] Available: https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html
J. Li, “Area under the ROC Curve has the most consistent evaluation for binary classification,” PLoS One, vol. 19, no. 12 December, 2024, doi: 10.1371/journal.pone.0316019.
scikit-learn developers, “RandomizedSearchCV — scikit-learn 1.9.0 documentation,” 2026. [Online] Available:
https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.RandomizedSearchCV.html
O. Rainio, J. Teuho, and R. Klén, “Evaluation metrics and statistical tests for machine learning,” Sci. Rep., vol. 14, no. 1, pp. 1–14, 2024, doi: 10.1038/s41598-024-56706-x.
L. Schneider, B. Bischl, and M. Feurer, “Overtuning in Hyperparameter Optimization,” Proc. Mach. Learn. Res., vol. 293, pp. 1–43, 2025, doi: https://doi.org/10.48550/arXiv.2506.19540.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Perbandingan Grid Search dan Random Search untuk Optimasi Hyperparameter Random Forest pada Klasifikasi Kanker Payudara
ARTICLE HISTORY
How to Cite
Issue
Section
Copyright (c) 2026 Fiona Yenisya Dewi, Bayu Rizkya Pratama, Sunaryono Sunaryono

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (Refer to The Effect of Open Access).













