## 2 Materials and Methods
### Prediction and Optimisation Models
#### 2.3.4 HKOA-LSTM
\tag{20}\]  
\[\ell=\overset{\rightarrow}{U}\times\mathcal{M}\times\mathcal{L} \tag{21}\]  
\[\mathcal{L}=\left[\mu(t)\times\left(M_{5}+m_{i}\right)\left|\frac{2}{R_{i}(t) +\varepsilon}-\frac{1}{a_{i(t)}+\varepsilon}\right|\right]^{\frac{1}{2}} \tag{22}\]  
\[\mathcal{M}=\left(r_{3}\times\left(1-r_{4}\right)+r_{4}\right) \tag{23}\]  
\[\overset{\rightarrow}{U}=\begin{cases}0\quad\overset{\rightarrow}{r_{5}} \leq\overset{\rightarrow}{r_{6}}\\ 1\quad\quad\text{\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quadrepresents the distance between the sun \(X_{s}\) and the target planet \(X_{i}\) at time t; \(R_{i-norm}(t)\) signifies the normalised value of the Euclidean distance between the sun \(X_{s}\) and the target planet \(X_{i}\) at time t; \(R_{i}(t)\) represents the distance between the best solution \(X_{s}\) and the object \(X_{i}\) at time t; \(X_{i,up}^{\rightarrow}\) denotes the upper bound vector of the lth decision variable; \(X_{i,low}^{\rightarrow}\) denotes the lower bound vector of the lth decision variable; \(\overset{\rightarrow}{X_{i}}\) denotes the position vector of the lth planet in the search space; and \(T_{i}\) represents the orbital period of object i. Step 4: Revise the planet's location and its distance from the sun. \[\overset{\rightarrow}{X_{i}}(t+1)=\overset{\rightarrow}{X_{i}}(t)+\Gamma \times\overset{\rightarrow}{V_{i}}(t)+\left(F_{S_{i}}(t)+\left|r\right| \right)\times\overset{\rightarrow}{U}\times\left(\overset{\rightarrow}{X_{s} }(t)-\overset{\rightarrow}{X_  
\(T_{max}\) denotes the maximum number of iterations. Secondly, an update program is intended to further investigate the search space to identify regions that may harbour solutions. This updating mechanism utilises Levy flight and the normal distribution to provide various step sizes, hence maximising coverage of the search space. The mathematical expression of the subsequent step is as follows:  
\[\stackrel{{\rightarrow}}{{\mathrm{X}}}_{\mathrm{i}}=\left\{ \begin{array} []{ll}\stackrel{{\rightarrow}}{{\mathrm{X}}}_{\mathrm{i}}+RL \times\left(\mathrm{RL}\times\stackrel{{\rightarrow}}{{\mathrm{X} }}_{\mathrm{s}}(t)-\stackrel{{\rightarrow}}{{\mathrm{X}}}_{ \mathrm{i}}\right)&if\ r<r_{2}\\ \stackrel{{\rightarrow}}{{\mathrm{X}}}_{\mathrm{a}}+rn\times \left(\mathrm{m}\times\stackrel{{\rightarrow}}{{\mathrm{X}}}_{ \mathrm{b}}(t)-\stackrel{{\rightarrow}}{{\mathrm{X}}}_{\mathrm{r1 }}\right)&Else\end{array} \right. \tag{36}\]  
where \(RL\) denotes the value produced by the Levy flight, and \(rn\) is a randomly generated value in the interval (0, 1). Our suggested algorithm incorporates a stochastic trade-off between the first and second phases, as demonstrated in the subsequent equation:  
\[\stackrel{{\rightarrow}}{{\mathrm{X}}}_{\mathrm{i}}=\left\{ \begin{array}{ll}Eq. (\ref{eqThe issue of overfitting must be mitigated during the training of LSTM models, which arises when the model's complexity increases excessively due to an abundance of parameters. This complexity results in duplicate information during the model fitting process, diminishing its capacity to generalise to new data. Although augmenting the training dataset may alleviate overfitting, acquiring such data through experiments can incur substantial expenses. Consequently, creating models that can proficiently generalise predictions with minimal data is essential. To tackle this difficulty, we improved the primary hyperparameters of the LSTM model (learning rate, time step, batch size, and number of training epochs) via HKOA, and the optimal hyperparameters are presented in Table 4. \begin{table}
\begin{tabular}{l l} \hline \hline
**Hyperparameters** & **Values** \\ \hline Layers & 1–4 \\ No. of neurones & 1–150 \\ Learning rate & 0.001 \\ Optimiser & Rmsprop \\ No. of batch size & 10 \\ No. of epochs & 65 \\ Time steps & 11 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: HKOA-LSTM hyperparameter values. Figure 5: HKOA-LSTM flowchart.