## 3 Prediction Method
### Output Weight Optimization Method Based on WOA  
In model integration, optimizing the combined weights of different models can significantly improve overall model performance. By reasonably assigning the weights of each model, we can exploit the characteristics of various models to achieve more accurate and robust predictions. To achieve this goal, we use the Whale Optimization Algorithm [38] in this paper. WOA is a meta-heuristic algorithm based on group intelligence, which simulates the bubble net attack and predation behavior of whales. WOA is selected for weight optimization due to its superior performance across various scenarios. As shown in [38], WOA demonstrates strong local search ability in single-peak function tests, excels in global search for multi-peak functions, and achieves a well-balanced exploration-exploitation trade-off in composite function optimization. In engineering applications, it outperforms many traditional optimization algorithms, such as PSO and GA, in average performance and computational efficiency for complex structural design tasks. Additionally, WOA features diverse and efficient convergence modes, enabling faster and more accurate approximation of the global optimum than most conventional methods. These advantages make WOA well-suited for optimizing integrated model weights and enhancing overall performance. To enhance the performance of the ensemble model, assuming we have \(R\) neural network models, the goal is to optimize the weight combination by minimizing the following loss function. The optimization problem can be formally expressed as the objective function under the following constraints:  
\[\begin{array}{l}\min\limits_{w_{1},w_{2},\ldots,w_{R}}L=\frac{1}{n}\sum \limits_{i=1}^{n}\left(y_{i}-\sum\limits_{r=1}^{R}w_{r}f_{r}  
and \(n\) is the total number of samples. The constraint \(\sum_{r=1}^{R}w_{r}=1\) ensures that the sum of the weights equals 1, making the weighted combination of the ensemble model a convex combination. The constraint \(w_{r}\geq 0\) ensures that all weights are non-negative, thereby preventing any model from contributing negatively to the ensemble. The WOA process includes the following four main steps:  
* Population initialization: During the initialization phase, \(N\) whale population positions are randomly generated, where each position vector \(POS_{i}\) corresponds to a possible combination of weights. These initial positions are randomly distributed within the interval [0,1] and satisfy the constraint that the sum of all weights equals 1.
* Adaptation evaluation: For each population position \(POS_{i}\), calculate its adaptation value \(f(POS_{i})\), which is based on the loss function \(L\).
* Position update: During the position update process, a random number \(p\) in the interval [0, 1] is introduced to determine the behavior mode of the whales. \(A\) and \(C\) are the coefficients for position adjustment, defined as: \[A=2\times a\times r-a,C=2\times r\] (10) where \(a\) is a parameter that gradually decreases with the number of iterations, starting from an initial value of 2 and reducing to 0, to balance global search and local exploitation. \(r\) is a random number between [0, 1]. The algorithm selects different update mechanisms based on the values of \(p\) and \(|A|\). The following is a detailed description of the three mechanisms. Encircling prey mechanism: If \(p<0.5\) and \(|A|<1\), the whale contracts around the current optimal position and moves closer: \[POS_{i}(t+1)=POS^{*}(t)-A\times|C\times POS^{*}(t)-POS_{i}(t)|\] (11) where \(t\) is the iteration number, and \(POS^{*}(t)\) represents the optimal individual position found in the current iteration. Through this mechanism, the whale can progressively shrink the surrounding area of the prey, thus achieving a fast approach to the optimal solution.