## 3 Methodology
### The Proposed Metaheuristic-Based Feature and Hyperparameter Optimization
#### 3.4.2 HSMO Optimizer
\[SMnew_{ij}=SM_{ij}+R(0,\ 1)\times\left(GL_{j}-SM_{ij}\ \right)+R(-1,\ 1)\times \left(SM_{rj}-SM_{ij}\ \right) \tag{11}\]  
\(GL_{j}\) is the position of the global leader in the \(j^{th}\) dimension. The spider monkey that is updated may depend on the specific probabilistic value of each monkey \(SM_{i}\), which is calculated based on its fitness value \(fitness_{m}\) and the maximum fitness value \(fitness_{max}\) based on Equation (12). This is conducted using the fitness function, which calculates the fitness value for each spider monkey based on its objective function value \(f_{i}\) using Equation (13). A monkey with high fitness will receive more of a chance for the update, and this value may change over time as the simulation progresses. \[p_{m}=0.9\times\frac{fitness_{m}}{fitness_{max}}+0.1\] (  
Local Leader Decision Phase:  
In the local leader decision phase, the algorithm checks if the local leader has improved the fitness function based on the local counters. If it has improved, then the local leader is retained and the other members of the group are updated to be closer to the local leader. But when group limits exceed the local limit threshold, then it indicates a saturation in solution and all the monkeys of that group are marked for a decision update. These group updates can occur after at least some iterations have been completed because in each iteration, the increments are made only once. If these updates are not made before the incremented values exceed the local leader limit, it indicates that the local leader has not improved the solution for a certain number of iterations. Then, the algorithm resets the counter to 0, and the positions of all the members of that group are updated with parameters from local and global leaders using Equation (14), or it is completely randomly reinitialized using Equation (9). This update is based on the change threshold value. \[SMnew_{ij}=SM_{ij}+U(0,\;1)\times\left(GL_{j}-SM_{ij}\right)+rand[0,\;1]\times \left(SM_{rj}-LLk_{j}\right) \tag{14}\]  
The purpose of this phase is to strike a balance between exploration and exploitation. By periodically updating the positions of all group members, the algorithm aims to overcome potential stagnation and encourage further exploration of the solution space. Global Leader Decision Phase:  
In the global decision phase, if a global solution is saturating, then all the groups are dissolved. If the M groups had existed, then \(M+1\) groups are created from scratch and decide fission process. Each group is marked a new local leader based on the fitness value of members of the groups, and the local limit counts for each group are also reset. However, if M + 1 is greater than the number of maximum groups (MGs) that can exist, then M is set to 1, meaning that all monkeys become part of the same group, e.g., fusion. Perturbation rate:  
The perturbation rate pr is a significant parameter in the metaheuristic algorithm as it determines the likelihood of perturbing the parameters and plays a crucial role during the balancing of exploration and exploitation in the optimization process. Finding the appropriate degree of perturbation is often a matter of experimentation and tuning [38]. In the proposed HSMO, the pr value is modified to dynamically updated at each iteration using Equation (7). The value of \(pr\) is typically a value between 0 and 1. \[pr_{cur\;iter}=pr_{cur\;iter-1}+\frac{pr\;increment}{cur\;iter} \tag{15}\]  
Equation (15) states that the \(pr\) will increase by a fixed increment value divided by the current iteration number. This action can help to reduce the likelihood of making drastic changes in the search process, which could lead to premature convergence or instability. The perturbation rate parameter has an impact on both the local leader phase and the local leader decision phase. The purpose of gradually increasing \(pr\) over iterations is to taper off updates.