Abstract
This study presents a data-driven and explainable hybrid machine learning framework for soil fertility assessment and crop recommendation using the rds_crop_soil_dataset_2020_2025, a structured dataset aligned with India’s Soil Health Card (SHC) scheme. The dataset comprises 1500 samples and 19 agronomic and climatic features, including macronutrients (N, P, K), micronutrients (Zn, Fe, Cu, Mn, B, S), and soil properties (pH, EC, OC), along with environmental variables such as temperature and rainfall. The proposed approach integrates unsupervised K-Means for soil fertility zoning with a soft-voting ensemble model combining Random Forest and XGBoost for crop prediction. Model interpretability is ensured using SHAP-based feature importance and dependency analysis, enabling transparent decision-making aligned with agronomic knowledge. The hybrid model achieves 97% accuracy, outperforming individual baseline models across precision, recall, F1-score, and ROC-AUC metrics. Visual analyses, including pair plots, correlation heatmaps, and cluster projections, validate the relationships among soil parameters and model robustness. Although the dataset is synthetically structured, it closely reflects real-world SHC distributions, making the framework suitable for precision agriculture applications, policy planning, and intelligent decision support systems. This study contributes toward building scalable, interpretable, and region-aware AI solutions for sustainable agriculture in India.
Keywords: Crop Prediction; PCA; Precision Agriculture; Soil Fertility Classification; Soil Health Card (SHC); tdistributed Stochastic Neighbor Embedding (t-SNE).