Thông tin tài nguyên

Assessing the impact of climate variability on maize yields in the different regions of Ghana—A machine learning perspective

pmc-PMC11198792.pdf · Phiên bản 1 · 24 trang

18
Bản gốc
Trang 9 · Đoạn 27Vị trí nguồn

to the ensemble to minimize a loss function. Each new model is taught to fix the errors com- mitted by the existing ensemble. The direction and size of the ensemble updates are chosen by the algorithm using gradient descent optimization. Given a training dataset with input features (Climate variables) represented by X and corresponding target values (maize yield) repre- sented by y, where X = {(xm, ym), for m = 1, 2, . . .n}, gradient boosting aims to construct an ensemble model say F(x) that approximates the true target values of y. With an initial model F0(x), the training for each iteration m = 1 to M is represented in Eq 8 which computes the negative gradient of the loss function with respect to the current ensemble model’s prediction. With a weak model say, wm(x), the updated ensemble model can be represented in Eq 8, where wm(x) approximates the negative gradients and corrects the errors made by the current ensem- ble model, ρm is the optimal learning rate or step size which controls the contribution of the weak model to the ensemble. The final ensemble model in the gradient boosting is shown in Eq 10. gm ¼ rgLðy; Fm 1 x ð ÞÞ ð8Þ Fm x ð Þ ¼ Fm 1 x ð Þ þ rm � wmðxÞ ð9Þ F x ð Þ ¼ F0 x ð Þ þ r1 � w1 x ð Þ þ r2 � w2 x ð Þ þ � � � þ rm � wm x ð Þ ð10Þ The stacking ensemble learning model establishment. Stacking is a type of ensemble learning technique that combines multiple base models to improve the overall performance of the model. The predictions from various base models are used as input in the stacking ensem-

Trang 9 · Đoạn 28Vị trí nguồn

ble learning model, which learns how to combine the predictions to make the final prediction through a secondary learning process known as meta-learning, which improves the accuracy and stability of the prediction [48]. The predictive performance of models in the available input subsets is estimated and evaluated in this work using cross-validation techniques. This technique is effective in avoiding overfitting and would be helpful in handling small datasets [34]. Motivated by studies in [40, 47, 49], this study employs a 5-fold cross-validation. This is a well-known cross-validation strategy for optimizing model hyperparameters and evaluating model performance [47]. Each model is trained on ’k-1’ folds of the k-folded input training dataset before being validated on the fold that was not used in training. The technique is applied k times, with the validation fold being changed each time. The forecasts are then stored in train-meta so that they can be utilized as features or inputs for the stacking model. We defined parameter grids for the base models’ hyperparameter tuning. For the linear regression model, we kept the default values for its parameters, setting "fit intercept" to true and "normalize" to false. In the case of the decision tree model, we specified the options for the maximum depth, which could be none, 5, 10, or 15. The minimum sample split had choices of 2, 5, or 10, and the minimum sample leaf could be 1, 2, or 4. Regarding the random forest model, we provided options for the number of estimators: 100, 200, or 500. We also set the

Trang 9 · Đoạn 29Vị trí nguồn

maximum depth to none, 5, 10, or 15, and the minimum sample split and minimum sample leaf had the same choices as the decision tree model. For the support vector machine model, we set the degree parameter to select from 2, 3, or 4. The kernel had options of linear, poly, rbf, or sigmoid. Additionally, the ’C’ parameter, representing the size of the margin value for the support vector regression model to select from either 0.1, 1, or 10. In the gradient boosting model, we defined the learning rate to select from 0.1, 0.05, or 0.01, and the number of estima- tors could be 100, 200, or 500. To fine-tune each base model’s hyperparameters, we utilized GridSearchCV with 5-fold cross-validation and evaluated them using the negative mean PLOS ONE Impact of climate variability on maize yields in Ghana PLOS ONE | https://doi.org/10.1371/journal.pone.0305762 June 25, 2024 9 / 24