## 4 Methodology  
The methodology employed in this study aimed to comprehensively evaluate the predictive performance of various machine learning models in forecasting the uniaxial compressive strength (UCS) of rocks encountered in oil and gas wells. The analysis centred on five key input parameters: weight on bit (WOB), Sonic Transit Time (DT), Density Tool Reading (NPHI), rate of penetration (ROP), and Bulk Density (RHOB). Each of these features plays a significant role in determining the UCS of the rock. For instance, Bulk Density provides insight into the mineral composition and density of the rock, which directly correlates with its mechanical strength. Sonic Transit Time reflects the elasticity and acoustic properties of the rock, while Neutron Porosity indicates the porosity level, which affects fluid saturation and overall rock strength.  
A correlation heatmap and scatter plots were generated (Figures 1 and 2) to visually depict the relationships between UCS and the input variables, facilitating a preliminary understanding of the dataset's characteristics.  
Figure 1: Correlation heatmap between UCS and the input parameters.  
Figure 2: Scatter plots between the inputs and UCS.  
The dataset, comprising 111 data points, was meticulously curated to ensure its representativeness and suitability for model training. To assess the model's performance accurately and prevent overfitting, we employed a standard 80:20 train-test split. During model development, we also conducted cross-validation with 6 folds to further validate the models' performance and ensure robustness. This approach allowed us to mitigate the risks of overfitting, ensuring that our findings are not only reliable but also generalizable to unseen datasets. While our current dataset comprises 111 data points, which may limit the generalizability of our conclusions, we acknowledge this limitation and plan to expand our dataset in future studies to further validate our results and improve model robustness.  
Each machine learning model, including Linear Regression, Random Forest, Gradient Boosting, XGBoost, SVM-SVR, and MLP-ANN, underwent a systematic training process. This process involved feeding the models with the training dataset and iteratively adjusting their parameters to minimize prediction errors and optimize predictive accuracy. For the Random Forest model, the best hyperparameters identified are a maximum depth of 10, a minimum number of 2 leaf samples, a minimum sample split of 5, and 100 estimators. In the case of Gradient Boosting, the optimal settings include a learning rate of 0.05, a maximum depth of 5, and 100 estimators, which facilitate effective learning without overfitting. XGBoost demonstrates improved performance with a learning rate of 0.15, a maximum depth of 5, and 100 estimators. The MLP-ANN model exhibits the best performance with a logistic activation function, a hidden layer configuration of 100 neurons, a constant learning rate, and stochastic gradient descent (SGD) as the solver. For the SVM, optimal hyperparameters comprise a regularization parameter C of 10, a gamma value set to \"scale\", and a linear kernel. Finally, LightGBM achieves its best predictive results with a learning rate of 0.15, a maximum depth of 5, and 100 estimators.  
Following model training, a rigorous evaluation was conducted using diverse statistical metrics. These metrics included Root Mean Squared Error (RMSE), Mean Squared Error (MSE), Mean Absolute Percentage Error (MAPE), Mean Percentage Error (MPE), Median Absolute Error, R\({}^{2}\) score, Adjusted R\({}^{2}\) score, Mean Squared Logarithmic Error (MSLE), Mean Bias Error (MBE), and geometric and symmetric Mean Absolute Percentage Error (MAPE). By analyzing these metrics, we were able to quantify the predictive accuracy, bias, and overall performance of each model, enabling a robust comparison and selection of the most suitable model for UCS prediction in oil and gas wells.