Data-Driven Crop Recommendation Using Machine Learning: A Comparative Study of Classification Algorithms
Keywords:
Classification algorithms, Crop recommendation, Machine learning, Precision agriculture, Random forestAbstract
Choosing the right crop for a given field is one of the earliest and most consequential decisions a farmer makes, yet across much of the developing world it is still guided by habit and word-of-mouth rather than by measurable soil and weather evidence. This paper develops and benchmarks a machine-learning-based crop recommendation model that maps soil nutrient concentration (nitrogen, phosphorus and potassium), soil pH, ambient temperature, humidity, and rainfall onto the most suitable crop for cultivation. Six supervised classifiers Random Forest, Decision Tree, Support Vector Machine, K-Nearest Neighbours, Logistic Regression, and Naïve Bayes were trained on a benchmark agronomic dataset and compared using accuracy, precision, recall, F1-score, and learning-curve diagnostics. Random Forest achieved the best overall balance, with 93.6% accuracy and an F1-score of 0.936, closely trailed by Decision Tree and Naïve Bayes, whereas the Support Vector Machine underfit the data and reached only 62.4% accuracy. These findings indicate that tree-based ensemble learners generalise more reliably on structured agronomic data than distance-based or margin-based classifiers, and they support the choice of Random Forest as the recommendation engine of a lightweight, cloud-deployable crop-advisory tool.
References
V. S. Sardeshmukh, S. B. Patil, and S. Bedage, “An AI-Driven Smart Crop Recommendation and Advisory Framework,” International Research Journal on Advanced Engineering Hub, vol. 3, no. 7, pp. 3209–3218, Jul. 2025.
T. Talaviya, D. Shah, N. Patel, H. Yagnik, and M. Shah, “Implementation of artificial intelligence in agriculture for optimisation of irrigation and application of pesticides and herbicides,” Artificial Intelligence in Agriculture, vol. 4, 2020.
A. Cavazza, Francesca Dal Mas, P. Paoloni, and M. Manzo, “Artificial intelligence and new business models in agriculture: a structured literature review and future research agenda,” British Food Journal, vol. 125, no. 13, pp. 436–461, Jul. 2023.
E. Elbasi et al., “Artificial intelligence technology in the agricultural sector: A systematic literature review,” IEEE Access, vol. 11, pp. 171–202, 2023.
A. S, M. S, and S. R, “AI-based smart crop recommendation system for sustainable agricultural production: A data-driven approach to minimize resource use and maximize yield,” Madras Agricultural Journal, vol. 112, no. 4–6, pp. 135–139, 2025.
J. Zha, “Artificial intelligence in agriculture,” Journal of Physics: Conference Series, vol. 1693, 2020.
Ritambara, S. Kaushal, and Shubham, “Frontiers of artificial intelligence in agricultural sector: Trends and transformations,” Journal of Scientific Research and Reports, vol. 30, no. 10, pp. 970–980, Oct. 2024.
N. A. M. Pauzi, S. M. Mustaza, N. Zainal, M. H. Mohd Zaman, and A. Mohamed Moubark, “Artificial intelligence in precision agriculture: A review,” Jurnal Kejuruteraan, vol. 37, no. 2, pp. 1025–1047, Mar. 2025.
S. Shastri, S. Kumar, V. Mansotra, and R. Salgotra, “Advancing crop recommendation system with supervised machine learning and explainable artificial intelligence,” Scientific Reports, vol. 15, Jul. 2025.
M. Y. Shams, S. A. Gamel, and F. M. Talaat, “Enhancing crop recommendation systems with explainable artificial intelligence: a study on agricultural decision-making,” Neural Computing and Applications, vol. 36, pp. 5695–5714, Jan. 2024.
R. A. Ahmed, W. El-Shafai, Z. A. Ahmed, E.-S. M. El-Rabaie, and F. E. A. El-Samie, “High-precision crop recommendation system with stacking ensemble classifiers for optimizing agricultural productivity,” Scientific Reports, vol. 15, Dec. 2025.
H. Afzal et al., “Incorporating soil information with machine learning for crop recommendation to improve agricultural output,” Scientific Reports, vol. 15, Mar. 2025.
A. Chauhan, A. Kumari, A. Mishra, and D. Maurya, “Crop recommendation system using machine learning,” International Journal of Current Sciences, vol. 14, no. 2, pp. 111–128, May 2024.
G. Singh and S. Sharma, “Enhancing precision agriculture through cloud based transformative crop recommendation model,” Scientific Reports, vol. 15, Mar. 2025.
S. A. Mohamed et al., “A hybrid deep learning and rule-based model for smart weather forecasting and crop recommendation using satellite imagery,” Scientific Reports, vol. 15, Oct. 2025.
K. Janani, R. Alageswaran, and R. Amirtharajan, “Dynamic SG-SKRDX hybrid framework for precision weather forecasting and crop suitability in the Cauvery Delta,” Scientific Reports, vol. 16, Dec. 2025.
S. P. , P. Mishra, R. R. Mahishi, D. C. Changanti, P. M, and R. B. Jana, “Optimizing crop selection for sustainable agriculture: a compound ensemble approach integrating machine learning and IoT-based sensors,” Scientific Reports, vol. 16, Mar. 2026.
S. M. Venkateswara and J. Padmanaban, “Interpretable deep learning models for independent fertilizer and crop recommendation,” Scientific Reports, vol. 15, Nov. 2025.
L. Goel, N. Kumar, S. Jain, and Y. Agrawal, “Improving precision agriculture using integrated bio-inspired optimization models for crop recommendation in Rajasthan, India,” Scientific Reports, vol. 16, Feb. 2026.
Md. S. Bin Alam, V. Esichaikul, A. Lameesa, S. F. Ahmed, and A. H. Gandomi, “An approach for crop recommendation with uncertainty quantification based on machine learning for sustainable agricultural decision-making,” Results in Engineering, vol. 26, Jun. 2025.
R. R. Kulkarni, V. V. Deshpande, A. R. Menon, and E. M, “An augmented reality enabled mobile decision support system for intelligent crop recommendation and yield estimation,” Results in Engineering, vol. 30, Jun. 2026.
N. L. P. Swati, S. V. Gupta, N. S. Duddela, and L. Rama Parvathy, “Agentic AI-driven autonomous decision support system for smart agriculture,” Scientific Reports, vol. 16, Feb. 2026.
H. Mishra and D. Mishra, “AI for data-driven decision-making in smart agriculture: From field to farm management,” in Artificial Intelligence Techniques in Smart Agriculture, S. S. Chouhan, A. Saxena, U. P. Singh, and S. Jain, Eds. Singapore: Springer, 2024, pp. 173–193.
H. Pasley, H. Brown, D. Holzworth, J. Whish, L. Bell, and N. Huth, “How to build a crop model. A review,” Agronomy for Sustainable Development, vol. 43, Dec. 2022.
U. Grewer, A. Zull, R. Anderson, and K. G. Pembleton, “Crop models as decision support tools in digital agriculture: The APSIM-based RotationARM tool in Australia,” Computers and Electronics in Agriculture, vol. 247, Jun. 2026.
M. Gallardo, J. M. Cedeño, J. J. Magán, M. D. Fernández, and R. B. Thompson, “Adaptation of VegSyst-DSS for N, P and K recommendations for grafted tomato grown in perlite in Mediterranean greenhouses,” Agricultural Water Management, vol. 310, Apr. 2025.
A. Rodas-Vásquez, C. M. Castillo-Rodriguez, M. Bermúdez-Edo, A. Molina-Cabrera, J. C. Chavarro-Porras, and C. A. Meneses-Escobar, “Nutrient recommendation model for plantain (Musa AAB) cultivation based on the analysis of soil variables in the Department of Risaralda, Colombia,” Journal of the Saudi Society of Agricultural Sciences, vol. 25, Jan. 2026.
G. D. Vyavahare et al., “Near-infrared spectroscopy for predicting soil properties and fertilizer recommendations in Korean cropping systems,” Environmental Technology & Innovation, vol. 43, Sept. 2026.
M. Palka et al., “Cropping history, agronomic rules, and commodity prices shape crop rotations across Central Europe,” Agricultural Systems, vol. 231, Jan. 2026.
G. Selvaraj, S. Kuppusamy, and M. Aswathanarayanan, “Sustainable crop recommendation system using seasonally adaptive recursive spectral convolutional neural network for responsible agricultural production,” Geomatics, Natural Hazards and Risk, vol. 16, Aug. 2025.
S. Mahmoudi, A. M. Damghani, H. Mahmoudi, and J. Kambouzia, “Sustainability-based policy planning: A hybrid fuzzy MCDM-derived evaluation of cropping systems in a semi-arid region of Iran,” Environmental and Sustainability Indicators, vol. 28, Dec. 2025.
R. Nithya and N. Narmadhavarshini, “An intelligent and secure IoT-based framework for crop price prediction in smart agriculture,” Array, vol. 31, Sept. 2026.