## 2 Materials and Methods
### Quantitative Assessment and Input Configuration  
It is common among classification studies using machine learning models to examine the performance of the derived features and the spectral bands both separately and fused [105; 106; 107; 108; 48]. To identify the most effective combination of predictors, we conducted a comparative analysis of five input configurations:  
* The four features selected from the importance ranking, with and without the inclusion of the 12 Sentinel-2 bands;
* The 25 features prior to the selection procedure, with and without the inclusion of the 12 Sentinel-2 bands;
* The 12 Sentinel-2 bands solely.  
The performance of the random forest was assessed on each configuration for the raw dataset and the refined dataset using the independent refined test data. The random forest that yielded the highest accuracy was employed for classifying the study area. We calculated the pixel-based measures of overall accuracy (OA), user's accuracy (UA), producer's accuracy (PA) [109] and F1 score based on the confusion matrix (see corresponding Equations (1)-(4)). The OA, which describes the total pixels classified correctly, was deemed suitable for our study because the sizes of the two classification classes were well-balanced. The UA, PA and F1 were expressed per class category. From the cocoa class standpoint, the UA (\(1-\) commission error) represents the proportion of cocoa pixels classified correctly with regard to all pixels classified as cocoa. The PA (\(1-\) omission error) represents the proportion of cocoa pixels classified correctly with regard to the total actual cocoa pixels. The F1, which is the harmonic mean of UA and PA, enables a comparison of models in cases where one model achieves higher UA while the other achieves higher PA, or vice versa. However, we did not compute the kappa coefficient of agreement since its utility and interpretation in classification studies have been questioned [110; 111].  
\[\text{Overall Accuracy}\left(\text{OA}\right)=\frac{\text{TP}+\text{TN}}{ \text{TP}+\text{FP}+\text{TN}+\text{FN}} \tag{1}\]  
\[\text{User}^{\prime}\text{s Accuracy}\left(\text{UA}\right)=\frac{\text{TP}}{ \text{TP}+\text{FP}} \tag{2}\]  
\[\text{Producer}^{\prime}\text{s Accuracy}\left(\text{PA}\right)=\frac{\text{ TP}}{\text{TP}+\text{FN}} \tag{3}\]  
\[\text{F1}=2\times\frac{\text{UA}\times\text{PA}}{\text{UA}+\text{PA}} \tag{4}\]  
where TP is the number of true positives, TN is the number of true negatives, FP is the number of false positives and FN is the number of false negatives.  
After training the random forest on the training dataset, we assessed the performance ten times by resampling the test data with replacement, i.e., bootstrapping. This approach was adopted to account for the variability associated with the accuracy estimation and to ensure that the accuracy assessment did not rely solely on a specific set of the test data. However, the common practice in similar studies typically involves resampling by repeatedly splitting both training and test datasets to provide estimates of uncertainty [102; 107; 112; 113]. This resampling method demonstrated greater reliability compared with a single sampling iteration [114]. In our study, the division between the training and test datasets was kept fixed to retain the split concept applied for the cocoa and non-cocoa polygons, as described in Section 2.2.2. The resampling for the test data was performed at the polygon level. The mean value and the intervals of one standard deviation were derived for each accuracy measure.