Classification Model Optimization using Grid Search and Random Search in Machine Learning Algorithms - Parinduri, Syawaluddin Kadafi; Alkhairi, Putrama; Irawan, Irawan; Qurniawan, Hendry (Bulletin of Informatics and Data Science, 2025)
The performance of a machine learning model is highly dependent on the selection and tuning of appropriate hyperparameters. The main problem in this study is how to improve the accuracy and stability of a classification model without sacrificing computational time efficiency, especially in the case of kidney disease classification that requires accurate and fast prediction results. This study aims to optimize the classification model by applying two hyperparameter search methods, namely Grid Search and Random Search, to the Random Forest algorithm. The kidney disease dataset is used as a case study with preprocessing processes including data cleaning, missing value imputation, categorical variable encoding, and normalization. Each model is tested using accuracy, precision, recall, and F1-Score metrics. The results show that the Grid Search_RF model produces the highest performance with perfect accuracy, precision, recall, and F1-Score values (1.0000), while Random Search_RF provides results close to (accuracy 0.9875 and F1-Score 0.9900) with more efficient training time. Meanwhile, the standard Random Forest without tuning still shows competitive performance (accuracy 0.9917 and F1-Score 0.9930). Based on these results, it can be concluded that hyperparameter optimization, using both Grid Search and Random Search, can significantly improve the performance of the classification model, with Random Search being the most efficient method for practical implementation in machine learning-based disease detection systems.