# Prediction of Total Organic Carbon Content in Shale Based on PCA-PSO-XGBoost
## 3 Results and Discussion
### Comparative Analysis of Different Models  
To further illustrate the prediction effect of machine learning methods, an improved \(\Delta\)logR method was established for comparison [25]. The results are shown in Figures 7 and 8. In all datasets, the XGBoost prediction model has the highest accuracy with an \(R^{2}\) of 0.90 and RMSE of 0.1545, followed by the GBDT and BP neural network prediction models, with an \(R^{2}\) of 0.84 and 0.76, and an RMSE of 0.1956 and 0.2375, respectively. The improved \(\Delta\)logR method has the lowest accuracy with an \(R^{2}\) of 0.52 and an RMSE of 0.3397. The \(R^{2}\) values of different methods show significant variability. The superior performance of XGBoost stems from its ensemble learning architecture, which combines  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Hyperparameters** & **The Concept of Hyperparameters** & **Settings** \\ \hline \multirow{2}{*}{BPNN} & hidden\_layer\_sizes & The ith element represents the number of neurons in the ith hidden layer & (64, 64, 32) \\  & activation\_function & Activation function for the hidden layer & \(Relu\) \\ \hline \multirow{4}{*}{GBDT} & learning\_rate & Weight reduction factor for weak learners & 0.07 \\  & n\_estimators & The number of iterations for weak learners & 190 \\ \cline{1-1}  & min\_samples\_split & The minimum number of samples required to split internal nodes & 2 \\ \cline{1-1}  & min\_samples\_leaf & The minimum number of samples on leaf nodes & 1 \\ \cline{1-1}  & max\_depth & The maximum depth of tree & 4 \\ \hline \multirow{4}{*}{XGBoost} & learning\_rate & Weight reduction factor for weak learners & 0.08 \\ \cline{1-1}  & n\_estimators & The number of iterations for weak learners & 180 \\ \cline{1-1}  & subsample & Ratio of subsampling & 0.7 \\ \cline{1-1}  & colsample\_bytes & Controls the sampling scale of the number of columns in the tree & 0.6 \\ \cline{1-1}  & max\_depth & The maximum depth of tree & 5 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Hyperparameter settings of different models.  
Figure 6: The construction process of the TOC content prediction model.  
gradient-boosted decision trees with regularization, effectively capturing complex non-linear relationships while preventing overfitting. The relatively lower \(R^{2}\) values of the GBDT and BP neural network models reflect their respective limitations. GBDT lacks the built-in regularization of XGBoost, while the neural network's performance is constrained by the size and architectural complexity of the dataset. The improved \(\Delta\)logR method's substantially lower \(R^{2}\) value underscores the limitations of conventional petrophysical approaches in modeling complex reservoir relationships compared to machine learning algorithms. Furthermore, in this study, the XGBoost prediction model also outperformed other models on the training set and test set, with an \(R^{2}\) of 0.92 and 0.88 and an RMSE of 0.1417 and 0.1598, respectively. The consistency between training and testing also confirms the XGBoost model's excellent performance.  
Figure 8: Comparison between the evaluation metrics of different models on different datasets. (**a**) Comparison of RMSE of different models; (**b**) comparison of \(R^{2}\).  
Figure 7: Comparison between the prediction results of different models on all datasets. (**a**) Prediction results of improved \(\Delta\)logR; (**b**) prediction results of BPNN model; (**c**) prediction results of GBDT model; (**d**) prediction results of XGBoost model.