## 4 Discussion
### Optimization effect of K-means method for XGBoost model  
The K-means method of data grouping proved beneficial in improving the performance of the XGBoost model. The experimental porosity and permeability data were grouped by using K-means, and the porosity and permeability grouped XGBoost model reduced the MAE by 0.017 and improved R\({}^{2}\) by 0.15 relative to the ungrouped model, as shown in Figure 7. It is worth noting that the data volume is reduced to some extent by K-means, which increases the risk of model overfitting. However, the overall prediction effect is improved. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Algorithm** & **Group** & **Feature Combination** & \begin{tabular}{c} **Hyper-parameter** \\ **Values** \\ \end{tabular} & \begin{tabular}{c} **MAE of** \\ **Training Set** \\ \end{tabular} & \begin{tabular}{c} **MAE of** \\ **Test Set** \\ \end{tabular} & \begin{tabular}{c} **R\({}^{2}\) of** \\ **Training Set** \\ \end{tabular} & \begin{tabular}{c} **R\({}^{2}\) of** \\ **Set** \\ \end{tabular} \\ \hline \multirow{4}{*}{POR} & 0 & [AC, CAL, CNL, DEN, SP, RLLS, PE, GR] & \begin{tabular}{c} learning\_rate: 0.07 \\ max\_depth: 100 \\ min\_child\_weight: 20 \\ n\_estimators: 500 \\ \end{tabular} & 0.0006 & 0.0685 & 0.99 & 0.73 \\ \cline{2-8}  & 1 & [CAL, CNL, SP, RLLS, PE, GR, RT] & n\_estimators: 17 & 0.0135 & 0.0552 & 0.99 & 0.85 \\ \hline \multirow{2}{*}{PERM} & 0 & [AC, CNL, RLLS, RLLD] & n\_estimators: 100 & 0.0023 & 0.0085 & 0.98 & 0.32 \\ \cline{2-8}  & 1 & [AC, CAL, DEN, RT] & n\_estimators: 500 & 0.0008 & 0.0131 & 0.99 & 0.79 \\ \hline \multirow{4}{*}{LOG(PERM)} & 0 & [CAL, CNL, DEN, SP, RLLS, PE, GR, RT] & \
\begin{tabular}{c} learning\_rate: 0.01 \\ max\_depth: 40 \\ min\_child\_weight: 9 \\ n\_estimators: 800 \\ \end{tabular} & 0.0570 & 0.3520 & 0.98 & 0.61 \\ \cline{2-8}  & 1 & [CNL, SP, RLLS, RLLD, RT] & n\_estimators: 31 & 0.0482 & 0.2494 & 0.99 & 0.83 \\ \hline \multirow{4}{*}{Arctan(PERM)} & 0 & [CAL, CNL, DEN, SP, RLLS, PE, GR, RT] &
\begin{tabular}{c} learning\_rate: 0.1 \\ max\_depth: 80 \\ min\_child\_weight: 15 \\ n\_estimators: 100 \\ \end{tabular} & 0.0211 & 0.0842 & 0.96 & 0.58 \\ \cline{1-1} \cline{2-8}  & 1 & [CNL, SP, PE, GR, RT] & n\_estimators: 37 & 0.0009 & 0.0530 & 0.99 & 0.85 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Preferred values of hyper-parameters for the grouped XGBoost model. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Algorithm** & **Group** & **Feature Combination** & \begin{tabular}{c} **MAE of** \\ **Training Set** \\ \end{tabular} & \begin{tabular}{c} **MAE of** \\ **Test Set** \\ \end{tabular} & \
\begin{tabular}{c} **R\({}^{2}\) of** \\ **Training Set** \\ \end{tabular} &
\begin{tabular}{c} **R\({}^{2}\) of** \\ **Test Set** \\ \end{tabular} \\ \hline \multirow{2}{*}{POR} & 0 & [AC, CAL, CNL, DEN, SP, RLLS, PE, GR] & 0.0744 & 0.0544 & 0.98 & 0.68 \\  & 1 & [CAL, CNL, SP, RLLS, PE, GR, RT] & 0.0007 & 0.0563 & 0.99 & 0.84 \\ \hline \multirow{2}{*}{PERM} & 0 & [AC, CNL, RLLS, RLLD] & 0.0023 & 0.0085 & 0.98 & 0.32 \\  & 1 & [AC, CAL, DEN, RT] & 0.0008 & 0.0131 & 0.99 & 0.79 \\ \hline \multirow{2}{*}{LOG(PERM)} & 0 & [CAL, CNL, DEN, SP, RLLS, PE, GR, RT] & 0.0969 & 0.3761 & 0.96 & 0.58 \\  & 1 & [CNL, SP, RLLS, RLLD, RT] & 0.0010 & 0.2493 & 0.99 & 0.83 \\ \hline \multirow{2}{*}{Arctan(PERM)} & 0 & [CAL, CNL, DEN, SP, RLLS, PE, GR, RT] & 0.0246 & 0.0915 & 0.96 & 0.54 \\  & 1 & [CNL, SP, PE, GR, RT] & 0.0009 & 0.0530 & 0.99 & 0.85 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Grouped machine learning feature variable combination preference results. Effectiveness of XGBoost porosity and permeability modeling application  
This paper took the M42 well as an example to analyze the vertical application effect of the established XGBoost porosity and permeability model.