2.4. Lithotype-Conditioned Residual Characterization Framework
To improve geomechanical characterization under lithological heterogeneity, a lithotype-conditioned residual learning framework is established in this study. The underlying motivation is that, in heterogeneous coal-bearing formations, similar logging responses may correspond to different mechanical properties under different lithological regimes. Under such conditions, a single global mapping is often insufficient to fully describe the response relationship. To address this issue, the prediction is formulated as the sum of a global component and a lithotype-conditioned residual component.
Accordingly, the final prediction is expressed as
where
denotes the logging-derived input features at depth
d,
denotes the lithotype label derived from the HMLZ index,
represents the global mapping from logging responses to mechanical parameters, and
represents the lithotype-conditioned residual correction.
In implementation, both and are constructed using CatBoost regressors. The global model is trained using only logging features, while the residual model takes both logging features and lithotype as inputs. Lithotype is encoded as a categorical variable within CatBoost.
For multi-output prediction, separate models are trained for each target variable to ensure stable optimization. Hyperparameters are optimized using Bayesian Optimization based on validation error, and the same optimization protocol is applied to both stages to ensure fair comparison.
Residuals used to train are computed on the training set using predictions from without data leakage.
The function is used to learn the dominant relationship between logging responses and geomechanical parameters over the entire training dataset. It captures the general response trend shared across samples and reflects the lithology-independent component of the prediction. However, because the data are affected by lithological heterogeneity, this global model alone may leave systematic errors in intervals where different lithotypes exhibit different mechanical responses under similar logging signatures.
To characterize this effect explicitly, the residual is defined as
where
is the measured target vector and
is the deviation between the observation and the global prediction. In the proposed framework, this residual is interpreted as a structured correction term associated with lithological heterogeneity rather than as purely random noise. The function
is then used to learn the relationship between the residual, the logging responses, and the lithotype condition.
The training procedure is implemented sequentially. First, the global model is trained using the logging features to predict the target mechanical parameters. Second, the residuals are computed on the training set as the difference between the measured values and the predictions of the global model. Third, a residual model is trained using the logging features together with the lithotype variable, with the residual term as the prediction target. During inference, the output of the global model and that of the residual model are added to obtain the final prediction.
In practical implementation, lithotype is introduced as a categorical lithotype condition in the residual stage rather than being used only as an ordinary feature in a single unified predictor. This design allows the residual model to learn lithotype-dependent corrections to the global trend and thereby improves adaptability in heterogeneous intervals. The formulation does not assume that all samples follow exactly the same response relationship; instead, it allows systematic deviations associated with lithological regime to be represented in an explicit manner.
This decomposition also improves the interpretability of the modeling framework. The global component describes the dominant mapping shared by the dataset, whereas the residual component accounts for lithotype-related deviations from that common trend. In this sense, the final prediction can be understood as a combination of baseline geomechanical response and lithology-dependent correction.
It should be noted that the present framework is developed and validated using data from coal-bearing formations in the Ordos Basin. The applicability of this approach to other basins, lithologies, and logging configurations requires further verification.
In summary, the proposed lithotype-conditioned residual framework reformulates geomechanical characterization under heterogeneity as a decomposition problem composed of a global predictor and a lithotype-dependent correction term. This provides a more explicit way to represent heterogeneity-induced deviations and offers a physically more consistent basis for prediction under the geological conditions considered in this study.
2.4.1. Hyperparameter Optimization and SHAP Analysis
To ensure stable model construction, hyperparameter optimization was performed using Bayesian Optimization (BO). In this study, BO was used to search for suitable parameter combinations for the predictive model by minimizing the Mean Squared Error on the validation set. The optimized parameters mainly include the number of iterations, learning rate, tree depth, and L2 regularization coefficient. This procedure improves the stability of model training and reduces the risk of overfitting caused by manual parameter selection.
The purpose of hyperparameter optimization in this study is to obtain a stable and reproducible model configuration for subsequent comparison and analysis. It should be emphasized that the performance improvement of the proposed framework is not attributed to hyperparameter tuning itself, but to the introduction of lithotype-conditioned residual modeling under the same optimization protocol.
In addition, SHAP analysis was employed to examine the contribution patterns of the input features in the trained model. SHAP provides an additive explanation of model prediction and is used here only for supplementary interpretation rather than as primary evidence of the proposed formulation. It enables the contribution of each feature to be quantified at both the global and sample levels. For a given sample, the SHAP formulation can be written as
where
is the baseline output and
represents the contribution of the
jth feature.
The SHAP value of each feature is computed as the weighted average marginal contribution over all possible feature subsets:
In this work, TreeSHAP was used for efficient explanation of the tree-based model. The SHAP analysis was mainly used as an auxiliary interpretive tool to examine whether the learned prediction behavior is consistent with known geomechanical understanding. Specifically, global SHAP importance was used to identify the dominant logging variables affecting the prediction, while local SHAP analysis was used to inspect how feature contributions vary in different depth intervals and lithological settings.
It should also be noted that SHAP is not used here as the primary evidence for validating the proposed residual formulation. The main evidence for the effectiveness of the framework is still derived from cross-well evaluation, case-study comparison, and ablation analysis. SHAP is used only to provide supplementary interpretation of the trained model and to help assess whether the learned feature-response relationships remain physically plausible.
Therefore, BO and SHAP play different roles in the present study. BO is used to improve the stability of model training, whereas SHAP is used to provide auxiliary interpretive support for model behavior. Together, they complement the quantitative evaluation of the proposed lithotype-conditioned residual framework.