With the increasing global population and rising food demand, improving agricultural productivity through data-driven decision support systems has become essential. This study proposes a cross-validated meta-stacking ensemble framework for multi-class crop suitability prediction using soil nutrient and environmental parameters. The dataset consists of 2,200 samples covering 22 crop types and seven predictor variables, including nitrogen (N), phosphorus (P), potassium (K), temperature, humidity, pH, and rainfall. Six machine learning (ML) models—random forest (RF), decision tree (DT), light gradient boosting machine (LightGBM), extreme gradient boosting (XGBoost), support vector classifier (SVC), and k-nearest neighbors (KNN)—were trained and optimized using RandomizedSearchCV with k-fold cross-validation. A stacked ensemble model was then developed to combine heterogeneous learners and improve predictive robustness. Experimental results demonstrate that the RF model achieved an accuracy of 99.36%, while the proposed cross-validated meta-stacking ensemble achieved comparable performance with improved generalization stability. Precision, recall, and F1-score values of 0.99 indicate consistent classification across all crop classes. Feature importance analysis revealed N, K, and rainfall as the most influential predictors. Model robustness was evaluated using cross-validation and an independent test split to minimize overfitting risk. The findings highlight the effectiveness of ensemble learning for sustainable recommendation systems.
Copyrights © 2026