Environmental Factor-Oriented Crop Yield Prediction and Crop Recommendation Using Explainable Machine Learning
Environmental Factor-Oriented Crop Yield Prediction and Crop Recommendation Using Explainable Machine Learning
Abhijit Potty,Kevin Ketan Shah,Harshita Patel,D. Rajput
Abstract
This paper presents an environmental factor oriented, explainable machine learning framework for crop yield prediction and crop recommendation. This is done in the context of Indian agriculture. Seven regression models were evaluated using a district level dataset that spanned over 5 years (2020-2024). It incorporated features like rainfall, temperature, humidity, soil nutrients, and crop identity. Random Forest Regression achieved the best performance with an R2 score of 0.9974, MAE of approximately 400 kg/ha, and RMSE of about 1141 kg/ha. It significantly outperformed other linear models, SVR, and neural networks. To address the black box nature of machine learning, SHAP and Partial Dependence Plots were used to provide global and local explanations, revealing agronomical and meaningful patterns such as rainfall saturation, optimal temperature ranges, and nutrient-driven yield responses. An ablation study further showed that while crop identity explains crop yield variation between different crops, environmental factors govern intra-crop variability. A simulation-based crop recommendation module that evaluates all feasible crops under given environmental conditions and ranks them by expected yield was suggested after building upon the above insights. This is supported by SHAP based explanations. The proposed framework combines predictive accuracy, transparency, and actionable decision support, making it suitable for deployment in digital agriculture systems that are aimed at climate resilient and risk aware farming.
