Loading...
An Explainable Stacked Ensemble Learning Framework for Crop Recommendation using Soil and Climatic Parameters


Journal of Smart and Sustainable Farming

Received On : 12 February 2026

Revised On : 26 March 2026

Accepted On : 20 May 2026

Published On : 02 June 2026

Volume 02, 2026

Pages : 103-121


Abstract

Choosing the right crop for a piece of land relies on soil nutrients, soil acidity and local climate and if the wrong crop is selected, the yield will not be as good and inputs will be wasted. In this paper, an explainable stacked ensemble learning (EELE) model is presented which recommends one of the 22 crops based on seven soil and climatic parameters, namely, Nitrogen, Phosphorus, Potassium, Temperature, Relative Humidity, Soil pH and Rainfall. The base layer consists of random forest, histogram-based gradient boosting and a support vector machine with an RBF kernel, with the out-of-fold class probabilities being combined by a meta-learner, a multinomial logistical-regression. Permutation importance is introduced to indicate which parameters are important for a recommended classification. The system is tested on a test dataset consisting of 2200 samples generated by simulation from the ranges of agronomic requirements and is compared against eight classifiers serving as baseline classifiers. The held-out test set shows that the proposed model achieves 94.55% accuracy and 94.56% macro average F1 score, surpassing all baseline models, while a macro averaged AUC of 0.9994. It ranks second to a tuned SVM (94.59%) under 5×2 repeated cross validation and an ablation study reveals that the Gradient Boosting member makes the least contribution. The most important inputs are humidity, nitrogen and phosphorus. Learning Curves, noise robustness and computational cost are also reported and it discusses the limitations of what can be concluded from simulated data.

Keywords

Crop Recommendation, Precision Agriculture, Stacked Ensemble, Random Forest, Gradient Boosting, Support Vector Machine, Explainable Machine Learning.

  1. Rebina Ferdous, Soyaib Rahman, Salim Mia, and Hafizur Rahman, “A machine learning-based model for crop recommendation using Agro-climatic and soil nutrient parameters (Agrismart),” International Journal of Science and Research Archive, vol. 15, no. 3, pp. 1080–1089, Jun. 2025, doi: 10.30574/ijsra.2025.15.3.1713.
  2. H. Afzal et al., “Incorporating soil information with machine learning for crop recommendation to improve agricultural output,” Scientific Reports, vol. 15, no. 1, Mar. 2025, doi: 10.1038/s41598-025-88676-z.
  3. B. Dey, J. Ferdous, and R. Ahmed, “Machine learning based recommendation of agricultural and horticultural crop farming in India under the regime of NPK, soil pH and three climatic variables,” Heliyon, vol. 10, no. 3, p. e25112, Feb. 2024, doi: 10.1016/j.heliyon.2024.e25112.
  4. M. Venkatanaresh and I. Kullayamma, “Deep learning based concurrent excited gated recurrent unit for crop recommendation based on soil and climatic conditions,” Multimedia Tools and Applications, vol. 83, no. 24, pp. 64109–64138, Jan. 2024, doi: 10.1007/s11042-023-18004-y.
  5. V. Balaji K, K. S. Balamurugan, T. Thanarajan, and A. M. Selvi Sundarapandi, “MACHINE LEARNING-BASED CROP RECOMMENDATION SYSTEM INTEGRATING SOIL PROPERTIES AND WEATHER CONDITIONS WITH IOT-DRIVEN DATA COLLECTION,” Agrociencia, pp. 1–17, Feb. 2026, doi: 10.47163/agrociencia.v60i1.3428.
  6. S. M. Cheema and I. M. Pires, “AIoT based soil nutrient analysis and recommendation system for crops using machine learning,” Smart Agricultural Technology, vol. 11, p. 100924, Aug. 2025, doi: 10.1016/j.atech.2025.100924.
  7. M. Bouni, B. Hssina, K. Douzi, and S. Douzi, “Interpretable Machine Learning Techniques for an Advanced Crop Recommendation Model,” Journal of Electrical and Computer Engineering, vol. 2024, no. 1, Jan. 2024, doi: 10.1155/2024/7405217.
  8. G. Bora and V. Ganganwar, “Crop Recommendation System using Optimized Machine Learning Models,” 2026 International Conference on Emerging Smart Computing and Informatics (ESCI), pp. 1–6, Mar. 2026, doi: 10.1109/esci68015.2026.11493227.
  9. A. Ashwitha and C. A. Latha, “Crop Recommendation and Yield Estimation Using Machine Learning,” Journal of Mobile Multimedia, Feb. 2022, doi: 10.13052/jmm1550-4646.18320.
  10. Y. Mahale et al., “Crop recommendation and forecasting system for Maharashtra using machine learning with LSTM: a novel expectation-maximization technique,” Discover Sustainability, vol. 5, no. 1, Jun. 2024, doi: 10.1007/s43621-024-00292-5.
  11. A. Bhola and P. Kumar, “Farm-Level Smart Crop Recommendation Framework Using Machine Learning,” Annals of Data Science, vol. 12, no. 1, pp. 117–140, Jul. 2024, doi: 10.1007/s40745-024-00534-3.
  12. Y. Singh and A. Kaur, “Crop Recommendation Using Machine Learning,” International Journal of Science and Research (IJSR), pp. 211–216, Jun. 2026, doi: 10.21275/sr26603222613.
  13. D. Dahiphale, P. Shinde, K. Patil, and V. Dahiphale, “Smart Farming: Crop Recommendation using Machine Learning with Challenges and Future Ideas,” Jun. 2023, doi: 10.36227/techrxiv.23504496.
  14. F. S. Prity et al., “Enhancing Agricultural Productivity: A Machine Learning Approach to Crop Recommendations,” Human-Centric Intelligent Systems, vol. 4, no. 4, pp. 497–510, Sep. 2024, doi: 10.1007/s44230-024-00081-3.
  15. S. M. Shawon, N. I. Neha, A. N. Jui, N. Dey, and Md. M. S. Raihan, “AgriAI: Machine Learning Frameworks for Tailored Crop Recommendations using Soil Nutrient Parameters,” 2024 International Conference on Advances in Computing, Communication, Electrical, and Smart Systems (iCACCESS), pp. 1–6, Mar. 2024, doi: 10.1109/icaccess61735.2024.10499482.
  16. M. R. Islam, K. Oliullah, M. M. Kabir, M. Alom, and M. F. Mridha, “Machine learning enabled IoT system for soil nutrients monitoring and crop recommendation,” Journal of Agriculture and Food Research, vol. 14, p. 100880, Dec. 2023, doi: 10.1016/j.jafr.2023.100880.
  17. N. Agrawal, H. Govil, and T. Kumar, “Agricultural land suitability classification and crop suggestion using machine learning and spatial multicriteria decision analysis in semi-arid ecosystem,” Environment, Development and Sustainability, vol. 27, no. 6, pp. 13689–13726, Feb. 2024, doi: 10.1007/s10668-023-04440-1.
  18. 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, no. 1, Jul. 2025, doi: 10.1038/s41598-025-07003-8.
CRediT Author Statement

The authors confirm contribution to the paper as follows:

Conceptualization: Fen Huang and Benjamin Hutchinson; Methodology: Fen Huang; Software: Fen Huang and Benjamin Hutchinson; Data Curation: Benjamin Hutchinson; Writing- Original Draft Preparation: Benjamin Hutchinson; Visualization: Fen Huang and Benjamin Hutchinson; Investigation: Fen Huang and Benjamin Hutchinson; Supervision: Fen Huang and Benjamin Hutchinson; Validation: Benjamin Hutchinson; Writing- Reviewing and Editing: Fen Huang and Benjamin Hutchinson; All authors reviewed the results and approved the final version of the manuscript.

Acknowledgements

The authors gratefully acknowledge the support of the research laboratory and its staff for facilitating the experimental work.

Funding

No funding was received to assist with the preparation of this manuscript.

Ethics Declarations

Conflict of interest

The authors have no conflicts of interest to declare that are relevant to the content of this article.

Availability of Data and Materials

The simulator, the experiment code and the generated dataset can be obtained from the corresponding author on reasonable request.

Author Information

Contributions

All authors have equal contribution in the paper and all authors have read and agreed to the published version of the manuscript.

Corresponding Author



Rights and permissions

This is an open access article distributed under the terms of the Creative Commons Attribution 4.0 International License (CC BY 4.0).
https://creativecommons.org/licenses/by/4.0/.

This license permits unrestricted use, sharing, distribution, reproduction, and adaptation in any medium or format, including for commercial purposes, provided that appropriate credit is given to the original author(s) and the source, a link to the license is provided, and any changes made are indicated.

Copyright

© 2026 Fen Huang and Benjamin Hutchinson. The author(s) retain copyright of the work. The author(s) grant the Journal of Smart and Sustainable Farming (JSSF) and its publisher, Ansis Publications, the right of first publication and the right to identify itself as the original publisher of the article.

Cite this Article

Fen Huang and Benjamin Hutchinson, “An Explainable Stacked Ensemble Learning Framework for Crop Recommendation using Soil and Climatic Parameters”, Journal of Smart and Sustainable Farming, pp. 103-121, 2026, doi: 10.64026/JSSF/2026010.