# Prediction of Horizontal in Situ Stress in Shale Reservoirs Based on Machine Learning Models
## 3 Machine Learning Model
### Analysis of Dominating Factors  
Identifying the features with the greatest impact on horizontal in situ stress is crucial for model development. During actual well logging curve interpretation, various features may be influenced by numerous potential factors. This study combines Pearson correlation analysis with mutual information evaluation to assess feature correlations and their relevance to target variables. Recursive Feature Elimination and Random Forest regression are then used to screen and optimize features, eliminating redundancy and enhancing model generalization. First, the Pearson correlation coefficient matrix is calculated to measure linear relationships among features. Features with correlations exceeding the 0.6 threshold are flagged as potential redundant features. As shown in Figure 2a, this matrix provides a clear visualization of feature dependencies and highlights clusters of highly correlated features. For features with high Pearson correlation, the mutual information with the two target variables (maximum and minimum horizontal principal stress) is calculated. Mutual information in Table 1 quantifies the nonlinear dependence between features and targets, helping identify features with unique predictive contributions. A mutual information value between 0 and 0.3 indicates a weak correlation between the feature and the target variable. A value between 0.3 and 0.6 suggests a moderate correlation. A value between 0.6 and 1 implies a strong correlation. And a value greater than 1 shows an over-correlation between the feature and the target variable. Higher mutual information values indicate greater feature contributions to the target variables. However, features with over-correlation (mutual information > 1) may indicate multi-collinearity, carrying similar information. Models relying heavily on them may overfit and underperform on new data. Our feature selection priority based on mutual information is strong (0.6-1) > moderate (0.3-0.6) > weak (0-0.3) > over-correlation (>1). Thus, the mutual information threshold is set at 1. Features exceeding this threshold are considered redundant and are prioritized for removal. For pairs of highly correlated features (with Pearson correlations above the threshold), if both have mutual information below 1, the \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Features**} & \multicolumn{1}{c}{**Mutual Information Value**} & \multirow{2}{*}{**Features**} & \multicolumn{2}{c}{**Mutual Information Value**} & \multirow{2}{*}{**Features**} & \multicolumn{1}{c}{**Mutual Information Value**} \\ \cline{2-2} \cline{5-6}  & \multicolumn{1}{c}{} & & & & \\ \hline DEPTH & 1.816 & TVD & 1.234 & SV & 1.216 \\ PP & 1.195 & BDYN & 1.189 & AC & 0.987 \\ YMOD & 0.879 & TEMP & 0.862 & DTC & 0.862 \\ DTS & 0.721 & PF & 0.687 & GDYN & 0.623 \\ DTST & 0.617 & CAL & 0.584 & VPVS & 0.563 \\ PM1 & 0.561 & POIS & 0.558 & BRIT & 0.475 \\ CNL & 0.428 & GR & 0.337 & BP & 0.283 \\ RT & 0.255 & TH & 0.248 & URAN & 0.210 \\ PM2 & 0.209 & DEN & 0.208 & RXO & 0.200 \\ KTH & 0.188 & PE & 0.172 & K & 0.114 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Mutual Information Values Between Feature Values and Target Variables. feature with higher mutual information is retained. If one feature has mutual information above 1, that feature is removed. This process reduces redundancy while retaining predictive features. After iterative screening, the feature set is refined, and the Pearson correlation matrix is recalculated and analyzed to verify the elimination of redundancy. As shown in Figure 2b, the correlations in the refined matrix are significantly reduced, demonstrating the effectiveness of the feature selection method. Recursive Feature Elimination with Cross-Validation (RFECV) and Random Forest regression were used for feature screening and optimization. To prevent overfitting, the Random Forest's structure was constrained by limiting the maximum tree depth, increasing the minimum samples per leaf node, and reducing the number of trees.