Model Comparison and Feature Selection for Crop Recommendation - Harnan Malik Abdullah; Imam Fahrurrozi (Department of Computer Science, Faculty of Mathematics and Natural Sciences, University of Lampung, 2026)
Selecting crops appropriate to soil and environmental conditions is a crucial component of decision-making in smart agriculture. This study aims to evaluate the effect of feature selection on the predictive performance, stability, and computational efficiency of several machine learning models in crop recommendation tasks. The dataset employed in this study is a publicly available crop recommendation dataset, encompassing attributes such as nitrogen, phosphorus, potassium, temperature, humidity, pH, and rainfall. Six distinct models were evaluated: Logistic Regression, K-Nearest Neighbors, Support Vector Machine, Random Forest, XGBoost, and LightGBM, under two distinct conditions: utilizing all available features and employing a selection of features. The models' performance was assessed through various metrics, including accuracy, precision, recall, F1-score, the mean and standard deviation of cross-validation accuracy, as well as the inference time per sample. Random Forest outperformed other models, achieving high accuracies (0.993–0.995) across both full and selected feature scenarios. The model input was simplified with minimal performance impact by the feature selection, which left the temperature and pH unselected. These results indicate that environmental factors, in addition to soil nutrients, substantially affect crop recommendations. Consequently, this research underscores that the evaluation of models for crop recommendation should prioritize not only accuracy but also stability, inference efficiency, and feature relevance to facilitate practical application within smart agricultural systems.