Perbandingan Kinerja Machine Learning Perekomendasi Tanaman Berdasarkan Data Iklim dan Kondisi Tanah - Zidan Fahreza; Arwin Datumaya Wahyudi Sumari; Mila Kusuma (Ikatan Ahli Informatika Indonesia, 2025)
The selection of appropriate crop types according to agroclimatic conditions is a determining factor in the success of agricultural productivity. This study develops a machine learning-based crop recommendation system to classify 22 crop types based on seven agroclimatic parameters (N, P, K, temperature, humidity, pH, and rainfall). Four machine learning algorithms were compared for performance: K-Nearest Neighbors (KNN), Logistic Regression, Artificial Neural Network (ANN), and Decision Tree using a dataset of 2200 samples with an 80:20 split ratio for training and testing. Evaluation was conducted using accuracy, precision, recall, and F1-score metrics. The research results show that KNN with k=13 achieved optimal performance with 98.18% accuracy, 98.28% precision, 98.18% recall, and 98.17% F1-score. This algorithm outperformed Logistic Regression (97.27%), ANN (96.59%), and Decision Tree (95.23%). Confusion matrix analysis identified that classification errors primarily occurred in crop pairs with similar agroclimatic characteristics such as lentil-chickpea and pigeonpeas-kidneybeans. KNN proved to be the most suitable model for implementing precision agriculture decision support systems in the Indonesian agricultural context by providing high accuracy and good generalization capability.