# Dynamic Prediction of Shale Gas Drilling Costs Based on Machine Learning
## 3 Materials and Methods
### Optimisation Programme and Valuation Indicators  
1. Grid search represents a systematic approach to hyperparameter optimisation in machine learning models. The method functions by exhaustively testing predefined combinations of hyperparameters, including those related to learning rate, regularisation strength, and tree depth, through the utilisation of cross-validation for the assessment of model performance. Although grid search is an effective method for identifying optimal hyperparameter combinations and improving model performance through parallel computing, its efficiency is significantly reduced when dealing with large search spaces [50].
2. K-fold cross-validation represents a robust methodology for the assessment of machine learning models, whereby the dataset is partitioned into K equal subsets (commonly 5 or 10), with one subset designated as the validation set and the remaining K-1 subsets serving as the training set. This process is repeated K times, with each part serving as the validation set in turn, and the results are averaged to obtain the final performance evaluation. This approach effectively utilises all available data and helps to optimise model hyperparameters while avoiding the limitations of single train-test splits [51].
3. Mean Absolute Error (MAE) and Root Mean Square Error (RMSE) are two commonly used error assessment metrics to quantify the deviation between the predicted and actual values of a model [52]. MAE is the average of the sum of the absolute values of the differences between all predicted values and the true values, which measures the average deviation of the predicted values from the true values. The smaller the  
Figure 1: Multi-model collaborative application construction idea diagram.  
value of MAE, the smaller the deviation of the model's predicted results from the true values, indicating better prediction performance. RMSE is the square root of the average of the squares of the prediction errors. It not only focuses on the deviation between the predicted value and the true value, but also amplifies the effect of larger deviations, so RMSE is more sensitive to larger errors.  
\[MAE=\frac{1}{\mathbf{n}}{\sum_{i=1}^{n}}\left|y^{(i)}-\hat{y}^{(i)}\right| \tag{1}\]  
\[RMSE=\sqrt{\frac{1}{\mathbf{n}}{\sum_{i=1}^{n}}\left(y^{(i)}-\hat{y}^{(i)} \right)^{2}} \tag{2}\]  
where y\({}^{(i)}\) and \(\hat{y}^{(i)}\) are the true and predicted values of the sample, respectively, and n is the total number of samples.
4. Decision coefficient. The evaluation measures the strength of the model by calculating the coefficient of determination, where the value is in the range of (0, 1) and, the closer its value is to 1, the better the model is fitted [52].  
\[R^{2}=\frac{\sum_{i=1}^{n}\left(\hat{y}^{(i)}-\overline{\hat{y}^{(i)}}\right)^ {2}}{\sum_{i=1}^{n}\left(\mathbf{y}^{(i)}-\overline{\mathbf{y}^{(i)}}\right)^ {2}} \tag{3}\]  
where y\({}^{(i)}\) is the true value, \(\overline{\hat{y}^{(i)}}\) is the average value of the true value, \(\hat{y}^{(i)}\) is the predicted value, and \(\overline{\hat{y}^{(i)}}\) is the average value of the predicted value.