# Prediction of Horizontal in Situ Stress in Shale Reservoirs Based on Machine Learning Models
## 2 Experimental Datasets and Methods  
### Experimental Datasets  
The dataset utilized in this study comprises the logging curves of five wells from the 206H platform in the Luzhou Block, Sichuan Basin. Each well contains 32 logging curves, including depth (DEPTH), compensated acoustic wave (AC), caliper (CAL), compensated neutron (CNL), compensated density (DEN), natural gamma ray (GR), brittleness index (BRIT), transverse wave slowness (DTS), longitudinal wave slowness (DTC), Stoneley wave slowness (DTST), shear modulus (GMOD), bulk modulus (KMOD), true vertical depth (TVD), collapse pressure (BP), fracture pressure (PF), Poisson's ratio (POIS), pore pressure (PP), overburden pressure (SV), velocity ratio of transverse and longitudinal waves (VPVS),Young's modulus (YMOD), potassium (K), thorium (TH), uranium (URAN), uranium-free gamma ray (KTH), photoelectric index (PE), deep lateral resistivity (RT), shallow lateral resistivity (RXO), continuous well temperature (TEMP), upper limit of safe mud density (PM1), lower limit of safe mud density (PM2), maximum horizontal principal stress (SHMAX), and minimum horizontal principal stress (SHMIN). In the training dataset, all 32 logging curves are utilized as input features. In the testing dataset, thirty logging curves, including compensated acoustic wave, caliper, natural gamma ray, and collapse pressure data, are used as input variables, with the maximum and minimum horizontal principal stresses as the target variables. The target variables SHMAX and SHMIN are derived from a calculation method based on dynamic elastic parameters. This method relies on formation parameters such as P-wave and S-wave transit times and density obtained from well logging data. Additionally, dynamic-to-static conversion coefficients acquired through laboratory tests are used to accurately determine the in situ stress values. Furthermore, the results are calibrated using on-site measurement data. The final SHMAX and SHMIN values are then utilized for predictions in machine learning models. The training and testing datasets jointly form the dataset for developing the horizontal principal stress prediction model for the Luzhou Block. Detailed information about the division of the training and testing datasets will be provided in the subsequent data pre-processing section.  
In this study, well logging datasets from five wells are utilized. The depth range of the data is focused on the main shale gas-producing reservoir, spanning from 4000 to 6000 m. With 400 m of data extracted from each well at a sampling interval of 0.125 m, a total of 16,000 data samples covering a depth interval of 2000 m were obtained. Each well's data represents specific depth intervals, ensuring representativeness and enhancing dataset diversity. Using data from five wells instead of a single well aims to improve the model's generalization and adaptability. In geological exploration, logging data from different wells can vary due to factors like geological conditions and lithological properties. Training a model on data from a single well may lead to overfitting, limiting its applicability to other wells. By integrating data from five wells, this study reduces deviations caused by well-specific differences. This approach ensures the model's robust predictive performance across varying geological conditions, thereby enhancing its universality and reliability for practical applications.