Comparative analysis of gradient boosting and random forest regressors for nutrient prediction in smart agriculture
Accurate estimation of nutrient concentrations can support monitoring in hydroponic systems. This study compares Random Forest Regressor (RFR) and Gradient Boosting Regressor (GBR) for predicting nitrogen, phosphorus, and potassium from pH, electrical conductivity, temperature, and relative humidity in a precompiled agricultural sensor dataset. The framework uses mean imputation, correlation-based feature selection, and ensemble regression. Observations were randomly divided into 80% training and 20% test partitions; preprocessing, feature selection, and grid-search optimization with five-fold cross-validation were confined to the training partition. On the held-out test partition, GBR achieved lower MAE and RMSE and higher R² than RFR for all three nutrients. Unweighted arithmetic means of the reported nutrient-specific test metrics were MAE 3.60 versus 4.06, mean nutrient RMSE 4.22 versus 4.90, and mean nutrient R² 0.89 versus 0.84 for GBR and RFR, respectively. These summaries were calculated from the rounded nutrient-specific entries and are not pooled metrics. The comparison rests on one train–test split without quantified variability because fold-level scores were not retained and repeated-seed evaluations were unavailable. Missing acquisition metadata and unverified nutrient units further limit interpretation. The findings support GBR as a candidate for nutrient estimation within this dataset; external validation and operational evaluation are required before use in automated fertigation.
Authors
- Shaista Farhat (ORCID: https://orcid.org/0009-0008-9348-8370)
- Dr. Chokka Anuradha
- Dawit Tafesse Gebreyohannes
Institutions
- Hawassa University (ET)
- Koneru Lakshmaiah Education Foundation (IN)
Publication Details
- Journal
- Scientific Reports
- Published
- 2026-10-09
- DOI
- https://doi.org/10.1038/s41598-026-74825-5
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00