Afzal Hadeeqa, Amjad Madiha, Raza Ali, Munir Kashif, Villar Santos Gracia, Lopez Luis Alonso Dzul, Ashraf Imran
Institute of Information Technology, Khwaja Fareed University of Engineering and Information Technology, Rahim Yar Khan, 64200, Pakistan.
Department of Software Engineering, University of Lahore, Lahore, 54000, Pakistan.
Sci Rep. 2025 Mar 12;15(1):8560. doi: 10.1038/s41598-025-88676-z.
The agriculture field is the basis of a country's change and financial system. Crops are the main source of revenue for the people. One of the farmer's most challenging problems is choosing the right crops for their land. This critical decision has a direct impact on productivity and profit. Wrong crop selection not only reduces yields but also causes food shortages, creating more problems for farmers. The best crop depends on many parameters such as illustration humidity, N, K, P, pH, rainfall, and temperature of the soil. Getting advice from experts is not an easy task. This requires intelligent models in crop recommendations that use machine-learning models to suggest suitable crops for soil and other environmental conditions. Temperature, humidity, and pH are important data for growing crops in agriculture. In this study, we gather and preprocess relevant data. To recommend the most suitable crop, we propose a novel ensemble learning approach called RFXG based on random forest (RF) and extreme gradient boosting (XGB) to suggest the best crop out of the twenty-two major crops. To measure the capability of the proposed approach, various machine learning models are utilized including extra tree classifier, multilayer perceptron, RF, decision trees, logistic regression, and XGB classifiers. To get the best performance, optimization of hyperparameter, and K-fold cross-validation procedures are performed. Experimental outcomes show that the proposed RFXG technique achieves a recommendation accuracy is 98%. Specifically, the proposed solution provides immediate recommendations to help farmers make timely decisions.
农业领域是一个国家变革和金融体系的基础。农作物是人们主要的收入来源。农民面临的最具挑战性的问题之一是为他们的土地选择合适的作物。这个关键决策直接影响生产力和利润。选错作物不仅会降低产量,还会导致粮食短缺,给农民带来更多问题。最佳作物取决于许多参数,如土壤湿度、氮、钾、磷、pH值、降雨量和温度。向专家咨询并非易事。这就需要在作物推荐中使用智能模型,利用机器学习模型为土壤和其他环境条件推荐合适的作物。温度、湿度和pH值是农业作物种植的重要数据。在本研究中,我们收集并预处理相关数据。为了推荐最合适的作物,我们提出了一种基于随机森林(RF)和极端梯度提升(XGB)的新颖集成学习方法RFXG,以从二十二种主要作物中推荐最佳作物。为了衡量所提方法的能力,我们使用了各种机器学习模型,包括极端随机树分类器、多层感知器、随机森林、决策树、逻辑回归和XGB分类器。为了获得最佳性能,我们进行了超参数优化和K折交叉验证程序。实验结果表明,所提的RFXG技术实现了98%的推荐准确率。具体而言,所提解决方案提供即时推荐,以帮助农民及时做出决策。