# Prediction of Horizontal in Situ Stress in Shale Reservoirs Based on Machine Learning Models
## 5 Conclusions  
1. RFECV identified 9 key features from 30 initial well-logging curves, eliminating 21 weakly related ones to reduce redundancy. This enhances the model's interpretability and generalization in heterogeneous geological conditions. Bayesian optimization effectively adjusts hyperparameters like tree depth and learning rate, improving model convergence for a globally optimal configuration. Compared to grid and random search, this method reduces computational cost and ensures robustness across datasets.
2. The XGBoost model outperforms baseline models (SVM and RF) in SHmax and SHmin prediction. It achieved the highest R\({}^{2}\) (0.978 for SHmax, 0.959 for SHmin) and lowest error indicators (MAE, MSE, RMSE). This highlights its ability to capture the nonlinear relationship between logging parameters and stress distribution. However, the model's applicability to other shale formations has not been adequately researched, which may introduce certain limitations. Future studies can validate the model's performance across different shale formations to enhance its generalizability and reliability in varied geological settings.
3. The predicted SHmax and SHmin data reveal the reservoir's stress distribution, aiding in optimizing fracture propagation during hydraulic fracturing. In areas with low stress differences, adjusting fracturing parameters can enhance fracture uniformity. In areas with high stress differences, optimizing proppant carrying capacity ensures fracture conductivity.
4. The prediction results are useful for geomechanical modeling and wellbore stability design. In low-stress areas, high-density mud prevents wellbore collapse; in high-stress areas, optimizing casing strength improves well integrity. Field data like microseismic monitoring and stress logging can iteratively refine the prediction model, enhancing its applicability throughout shale gas development.  
Conceptualization, W.Y. and X.L.; methodology, X.L.; software, W.Y.; validation, X.P. and W.H.; formal analysis, W.G.; investigation, L.W. and Y.L. ([PERSON]); resources, W.G.; data curation, X.Y. and Y.L. ([PERSON]); writing--original draft preparation, W.Y.; writing--review and editing, W.Y.; visualization, H.Z.; supervision, H.Z.; project administration, W.G.; funding acquisition, X.L. All authors have read and agreed to the published version of the manuscript.  
This research received no external funding.  
**Informed Consent Statement:** Not applicable.  
**Data Availability Statement:** The data presented in this study are available on request from the corresponding author. The data are not publicly available due to some data confidentiality restrictions.  
**Conflicts of Interest:** Authors [PERSON], [PERSON], [PERSON], [PERSON], [PERSON], [PERSON], [PERSON], [PERSON] were employed by the company Research Institute of Petroleum Exploration and Development, PetroChina. Authors [PERSON], [PERSON], were employed by the company Shale Gas Research Institute of Southwest Oil and Gas Field Branch. The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as potential conflicts of interest.