Data-driven crop recommendation from soil and climate parameters: a comparative machine-learning study
Keywords:
Precision Agriculture, Machine Learning, Crop Recommendation, Random Forest, Soil Nutrients, Classification.Abstract
Choosing a crop that is best adapted to soils and climate is key to sustainable use of resources and maximization of yield, but often decisions on which crops to grow are based solely on experience. Machine learning provides a data-driven solution to correlate measurable field conditions with appropriate crops. Seven supervised classifiers (logistic regression, k-nearest neighbours, Gaussian naive Bayes, a decision tree, a support vector machine, random forest, and gradient boosting) are evaluated in this study on the publicly available dataset of crop recommendation with 2200 samples, corresponding to 22 different crops, and represented with 7 agronomic features: nitrogen, phosphorus, potassium content, temperature, relative humidity, soil pH, and rainfall. Following the standardization, models were compared with a held-out test set and 5-fold stratified cross validation. The best models were the ensemble models and the probabilistic ones, the former with a maximum of 99.45% accuracy in the test set and the latter with 99.59% accuracy in the cross-validated set. The rainfall, humidity and potassium were the most informative variables, as determined by feature importance analysis. The high accuracy was found to be due to the fact that most of the crops are grouped together nicely in the 2-dimensional principal component projection. The findings show that low cost soil and weather-based measurements can be used for accurate, automated crop recommendations which can help to facilitate precision-agriculture decision-making tools for smallholder and commercial farming.
Downloads
Published
How to Cite
Issue
Section
Copyright (c) 2025 Dr. T Rajendran

This work is licensed under a Creative Commons Attribution 4.0 International License.