PREDIKSI KATEGORI CURAH HUJAN BERBASIS MACHINE LEARNING UNTUK MENDUKUNG KETAHANAN PANGAN - I Dewa Gede Loka Maheswara; Kanaya Kaizzi Larasati; Muhammad Nur Rizqi; Muhammad Fany Nurwibowo; Yosafat Donni Haryanto (INTI Nusa Mandiri, 2026)
Rainfall variability significantly influences food security in Central Tapanuli Regency, North Sumatra, a region where agriculture is strongly reliant on climatic patterns. This research evaluates and compares the classification performance of Support Vector Machine (SVM), K-Nearest Neighbors (K-NN), and Random Forest (RF) for categorizing daily rainfall as supplementary information to strengthen food security. A total of 3,644 daily meteorological records obtained from FL Tobing Meteorological Station spanning 2015 to 2024 were utilized, encompassing seven predictor variables: minimum temperature, maximum temperature, average temperature, mean relative humidity, sunshine duration, peak wind speed, and average wind speed. To mitigate class imbalance, the original six rainfall categories were consolidated into four classes by merging the minority groups. The data were partitioned into training and testing subsets at an 80:20 ratio using stratified sampling, after which the Synthetic Minority Over-sampling Technique (SMOTE) was employed on the training set. Hyperparameter tuning was conducted through Grid Search combined with 5-fold cross-validation, and classification performance was assessed using accuracy, precision, recall, F1-score, and paired t-test analyses. The experimental results indicated that RF delivered superior performance, attaining an accuracy of 51.44% and a weighted F1-score of 0.5036, significantly outperforming both SVM and K-NN (p-value < 0.05). Feature importance analysis revealed that sunshine duration, average temperature, and maximum temperature were the most influential predictors. These outcomes demonstrate that RF holds considerable promise for advancing machine learning-driven rainfall category prediction systems capable of delivering early-stage information for agricultural planting schedules and preparedness against intense rainfall events in Central Tapanuli Regency