# Digital Mapping of Soil Organic Matter in Northern Iraq: Machine Learning Approach
## 4 Results and Discussions
### Model Performance  
The evaluation results, as summarized in Table 4, emphasize the statistical measures (MAE, RMSE, and R\({}^{2}\)) employed for the prediction model's precision. Meanwhile, Figure 5 illustrates the spatial pattern of the digital SOM generated by the XGBoost and RF models. This demonstrates noteworthy spatial heterogeneity in the SOM, with elevated predicted values predominantly concentrated in the central and southern regions. According to Table 4, the results of the prediction model show that the XGBoost model performed better than the RF model. The XGBoost model had a higher accuracy with an R\({}^{2}\) value of 0.92, RMSE of 0.62, and MAE of 0.41, compared to R\({}^{2}\) values of 0.77, 0.96, and 0.65, respectively. The enhanced precision of the XGBoost model can be attributed to its implementation of stochastic gradient boosting, thereby improving the methodology, mitigating overfitting concerns, and potentially enhancing predictive accuracy [46]. In summary, the XGBoost algorithm exhibited better performance than the RF algorithm, as evidenced by the higher R\({}^{2}\) values and lower RMSE values. Furthermore, as shown in Figure 6, XGBoost outperformed RF in its ability to predict SOM content. The precision of the outcomes produced by XGBoost surpasses that of RF as they exhibit a higher degree of alignment with the black 1:1 line. Upon closer examination of Figure 5a,b, for XGBoost and RF, respectively, it can be observed that there is a significant disparity between the predicted and test values. This finding provides additional support for the belief that XGBoost outperforms RF in terms of the accuracy in a given scenario. \begin{table}
\begin{tabular}{l l l l} \hline \hline
**ML Algorithms** & **MAE** & **RMSE** & **R\({}^{2}\)** \\ \hline
**XGBoost** & 0.41 & 0.62 & 0.92 \\
**RF** & 0.65 & 0.96 & 0.77 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparison of the accuracy of two ML models. Figure 5: SOM map created by (**a**) XGBoost model and (**b**) RF model. The XGBoost model exhibited notable efficacy in predicting SOM, corroborating the findings of [PERSON] et al. (2015), who similarly observed superior performance of the XGBoost model compared to other machine learning approaches for SOM prediction. Moreover, several studies within the domain of DSM have employed the XGBoost model to accurately predict soil properties and nutrient levels across diverse regions. For instance, [PERSON] et al. (2017) successfully employed this model in sub-Saharan Africa, [PERSON] et al. (2018) on soil properties in the United States, [PERSON] et al. (2019) on soil pH in China, [PERSON] et al. (2019) at a global scale for soil properties, and [PERSON] et al. (2019) estimated the depth to bedrock worldwide. However, [PERSON] et al. (2018) reported a lower level of precision in SOM prediction using the XGBoost model compared with the random forest (RF) model. It is important to note that the accuracy of the XGBoost model may vary significantly across studies, as evidenced by the aforementioned studies. These discrepancies may be due to differences in research regions, geography, sample density, and the number and quality of environmental variables employed, among other factors. Figure 6: Model performance in the prediction of SOM based on the testing dataset: (**a**,**c**) scatterplots depicting the comparison between measured and predicted SOM for both the XGBoost and RF models are presented, respectively; (**b**,**d**) measured and predicted SOM curves from the XGBoost model and RF model, respectively. In the expansive Batifa region of northern Iraq, this research sought to map SOM variability, emphasizing the advantages of a machine-learning model coupled with satellite remote sensing. Our model provides a unique landscape perspective, offering insights into regional SOM distribution that may elude individual soil analyses. This broad view can guide policymakers, regional planners, and agricultural associations in informed decision-making.