# Shear Mechanical Properties of Rock Joints Under Non-Uniform Load Based on DEM
## 5 Non-Uniform-Load Shear Strength Criterion Based on Machine Learning Methods  
The shear strength criterion provides an intuitive theoretical explanation for the strength properties of rock masses. However, due to the challenges in quantitatively describing the non-uniform distribution characteristics of loads, traditional shear strength criteria with quantitative parameters have become less applicable. In this study, prediction models were constructed using the XGBoost algorithm based on simulation results from direct shear tests. This algorithm can describe parameters both qualitatively and quantitatively. Additionally, XGBoost algorithms optimized by Whale, Particle Swarm, Genetics, and Bayesian algorithms were employed. By comparing the model's predicted values with the test data, we selected the algorithm that exhibited higher accuracy to build our prediction model. The XGBoost (Extreme Gradient Boosting) model is an integrated machine learning algorithm based on decision trees with a gradient boosting framework. XGBoost possesses numerous advantages, such as high accuracy, flexibility, impressive learning efficiency, and parallelizable algorithms, making it widely used in various industries for big data processing. The specific approach involves continuously splitting and growing the tree using predetermined feature values. Each additional tree learns a new function to fit the residuals of the previous prediction. Ultimately, training is completed by yielding k trees, and the score of a sample is predicted by combining these k trees. During this process, the CART regression tree model is employed. CART assumes that the regression tree is binary and performs splitting based on feature values; for instance, tree nodes are split according  
Figure 15: The relationship between energy and stress under different load distributions (standard deviations: UD = 0.125; NFC = 0.093; FOC = 0.088; FFC = 0.075): (**a**) Absorbed energy (**b**) Elastic energy (**c**) Dissipated energy. to the j-th feature value and divided into left and right subtrees depending on whether the feature value is less than s:  
\[\left\{ \begin{array}{l}R_{1}(j,s)=\left\{x\mid x^{(j)}\leq s\right\}\\ R_{2}(j,s)=\left\{x\mid x^{(j)}>s\right\}\end{array} \right. \tag{9}\]  
The typical objective function of a CART regression tree is  
\[\sum_{x_{i}\in R_{m}}(y_{i}-f(x_{i}))^{2} \tag{10}\]  
When solving for the optimal cut-off feature \(j\) and the optimal cut-off point \(s\), the function can be transformed as  
\[\min_{j,s}\left[\min_{c_{1}}\sum_{x_{i}\in R_{1}(j,s)}(y_{i}-c_{1})^{2}+\min_{ c_{2}}\sum_{x_{i}\in R_{2}(j,s)}(y_{i}-c_{2})^{2}\right] \tag{11}\]  
With the above equations, we can obtain the optimal cut features and cut points and finally build the regression tree. When the training is completed to obtain \(k\) trees, the scores corresponding to each tree are accumulated to obtain the predicted value of that sample. The specific calculation equation is as follows:  
\[\hat{y}=\varphi(x_{i})=\sum_{k=1}^{K}f_{k}(x_{i}) \tag{12}\]  
where  
\[F=\left\{f(x)=w_{q(x)}\right\}\left(q:R^{m}\to T,w\in R^{T}\right) \tag{13}\]  
where \(w_{q(x)}\) is the fraction of leaf nodes and \(f(x)\) is one of the regression trees. The dataset used to construct the strength prediction model consisted of test results from four different distribution forms under 21 different normal loads, totaling 84 sets of data (Table 3). It could be found that in these data, FFC had the highest strength under the same normal stress condition, which was consistent with the conclusion above. The model was trained using 75% of the samples as the training set, while the remaining 25% served as the test set for validation. Among all algorithms tested, Genetic-XGBoost yielded the highest R\({}^{2}\) value of 0.973 for predicting shear strength and was therefore chosen to construct the model. A weight algorithm module was introduced to calculate weights corresponding to load value and load distribution form [31].