# Hybrid Machine Learning Model for Predicting Shear Strength of Rock Joints
## 2 Methodology
### Slime Mold Algorithm (SMA)  
In recent years, metaheuristic optimization techniques that simulate natural phenomena such as biological evolution and collective behavior to find the optimal solution or parameter combinations have gained widespread attention [45; 46]. These techniques improve the predictive accuracy and generalization ability of ML models by adjusting their hyperparameters [47]. Considering the multivariable and nonlinear nature of the experimental data, as well as the time required for hyperparameter tuning, the slime mold algorithm (SMA) was ultimately chosen for parameter optimization.  
Originally proposed by [PERSON] et al. [48], SMA is a novel optimization algorithm based on swarm intelligence. It optimizes the objective function by simulating the behavioral characteristics of slime mold during the foraging process [49]. SMA has several advantages, including fewer parameters, fast convergence, and strong global optimization capabilities. To maximize food acquisition, slime mold dynamically adjusts its exploration direction, establishing the shortest and most optimal path to connect to the food. Figure 3 shows a schematic diagram of the foraging path of slime molds.  
Figure 2: A rock slope adjacent to a highway in Jiangxi province, China.  
The mathematical model of the slime mold foraging behavior is as follows:  
\[X(t+1)=\left\{\begin{array}{ll}X_{g}(t)+vb\cdot&[W\cdot X_{A}(t)-X_{B}(t)]&r_{1} <p\\vc\cdot X(t)&r_{1}\geq p\end{array}\right. \tag{1}\]  
where \(r_{1}\) is a random number uniformly distributed in the range [0, 1], \(vc\) is a parameter linearly decreasing from 1 to 0, and \(vb\) is a random number in the range [\(-\)a, a]. \(X_{g}(t)\) represents the position of the best fitness at the t-th iteration, while \(X_{(t\ +1)}\) and \(X_{(t)}\) denote the positions of the slime mold at the (\(t+1\))-th and \(t\)-th iterations, respectively. \(X_{A}(t)\) and \(X_{B}(t)\) represent the positions of two randomly selected slime molds at the t-th iteration, and \(W\) represents the weight of the slime mold.  
The parameters \(a\), \(p\), and weight \(W\) are calculated according to Equations (2)-(5), respectively.  
\[p=\tanh\lvert S(i)-DF\rvert \tag{2}\]  
\[\text{a}=arc\tanh\left[-\left(\frac{t}{\max t}\right)+1\right] \tag{3}\]  
\[\text{W}(SnellIndex(i))=\begin{cases}1+r_{2}\cdot\log\left(\frac{bF-S(i)}{bF- wF}+1\right)&condition\\ 1-r_{2}\cdot\log\left(\frac{bF-S(i)}{bF-wF}+1\right)&others\end{cases} \tag{4}\]  
\[SnellIndex=Sort(S) \tag{5}\]  
where \(S(i)\) represents the fitness of the \(i\)-th individual, \(DF\) denotes the currently obtained optimal fitness value, and \(\max t\) is the maximum number of iterations. \(r_{2}\) is a random number uniformly distributed in the range [0, 1], and condition indicates the individuals ranked in the top half based on fitness. \(bF\) and \(wF\) represent the best and worst fitness values obtained during the current iteration, respectively. SmellIndex refers to the fitness sequence, where the minimum values are arranged in ascending order.  
The SMA position update formula is as follows:  
\[X(t+1)=\begin{cases}rand(UB-LB)+LB&rand<z\\ X_{g}(t)+vb\cdot[W\cdot X_{A}(t)-X_{B}(t)]&r_{1}<p\\ vc\cdot X(t+1)&r_{1}\geq p\end{cases} \tag{6}\]  
Figure 3: Graphical representation of SMA [48], possible locations in (**a**) 2-dimension and (**b**) 3-dimension.  
where _UB_ and _LB_ represent the upper and lower bounds of the search space, respectively. The term rand denotes a random number uniformly distributed within the range [0, 1]. The parameter z defines the probability of an individual performing a global search. According to the literature [48], the algorithm achieves optimal performance when z is set to 0.03. More details of SMA are detailed in references [50; 51].