# Evapotranspiration Prediction Method Based on K-Means Clustering and QPSO-MKELM Model
## 2 Materials and Methods
### New Model
#### 2.4.2 Mkelm  
The ELM [40] is a single hidden-layer neural network proposed by [PERSON], GB, in 2006. As shown in Figure 1, its network structure consists of the input layer, hidden layer, and output layer. Compared to traditional BP neural networks and support vector machines, the weights between the hidden layer and the output layer are determined by solving the generalized inverse matrix. This eliminates the need to adjust connection weights, resulting in breakneck computation speed. Let x\({}_{1}\) to x\({}_{k}\) represent the k-dimensional input of the sample and y\({}_{1}\) to y\({}_{n}\) represent the n-dimensional target output. An ELM with L hidden layer neurons can be expressed as:  
\[\mathrm{y_{j}}=\sum_{i=1}^{L}\beta_{ij}G(X,\omega,b_{i}),j=1,2,\ldots n \tag{2}\]  
Let X be the input matrix and \(\omega\) be the connection weights randomly generated between the input nodes and the hidden layer nodes. b\({}_{i}\) represents the bias of the i-th hidden layer node. G(x) is the activation function of the hidden layer. The equation can be expressed as:  
\[\mathrm{H}\beta=\mathrm{Y}, \tag{3}\]  
where H is the feature mapping from the k-dimensional input space to the L-dimensional space, representing the hidden layer's output matrix, and \(\beta\) is the weight vector from the hidden layer to the output layer. By applying regularized least squares to minimize the loss function, the solution is obtained:  
\[\beta=\mathrm{(H^{T}H)}^{-1}\mathrm{H}\mathrm{Y} \tag{4}\]  
The least squares solution can easily lead to overfitting, which limits the model's generalization ability. Therefore, a regularization parameter C is introduced to reduce the risk of overfitting. Figure 1: Structure diagram of Extreme Learning Machine. The output weights \(\beta\) are then obtained as:  
\[\beta= \begin{cases}\mathrm{H}^{\mathrm{T}}(\frac{\mathrm{I}}{\mathrm{C}}+\mathrm{ HH}^{\mathrm{T}})^{-1}\mathrm{Y}&\mathrm{N}\leq\mathrm{L}\\ (\frac{\mathrm{I}}{\mathrm{C}}+\mathrm{HH}^{\mathrm{T}})^{-1}\mathrm{H}^{ \mathrm{T}}\mathrm{Y}&\mathrm{N}>\mathrm{L}\end{cases}  \tag{5}\]  
Kernel functions are introduced to enhance the performance of the ELM, leading to the KELM algorithm [41]. The main difference between KELM and ELM is that the kernel function, through kernel mapping, increases the dimensionality of the data, mapping linearly non-separable data in a low-dimensional space to a higher-dimensional space where it becomes linearly separable. The kernel matrix can be defined as:  
\[ \begin{cases}\Omega_{\mathrm{ELM}}=\mathrm{HH}^{\mathrm{T}}\\ \Omega_{\mathrm{ij}}=\mathrm{h}(\mathrm{x}_{\mathrm{i}})\!\cdot\!\mathrm{h}( \mathrm{x}_{\mathrm{j}})=\mathrm{K}(\mathrm{x}_{\mathrm{i}},\mathrm{x}_{ \mathrm{j}})\end{cases}  \tag{6}\]  
The kernel matrix \(\Omega_{\mathrm{ELM}}\) based on the kernel function replaces the \(\mathrm{HH}^{\mathrm{T}}\), \(\mathrm{h}(\mathrm{x})\) is the output matrix of the hidden layer, and \(\mathrm{K}(\mathrm{x}_{\mathrm{i}},\mathrm{x}_{\mathrm{j}})\) represents the kernel function. The output of the KELM can be expressed as:  
\[\mathrm{f}(\mathrm{x})=\mathrm{h}(\mathrm{x})\beta=\mathrm{h}(\mathrm{x}) \mathrm{H}^{\mathrm{T}}(\frac{\mathrm{I}}{\mathrm{C}}+\mathrm{HH}^{\mathrm{T} })^{-1}\mathrm{Y}=[\mathrm{K}(\mathrm{x},\mathrm{x}_{\mathrm{i}}),\mathrm{K}( \mathrm{x},\mathrm{x}_{\mathrm{j}}),\dots\mathrm{K}(\mathrm{x},\mathrm{x}_{ \mathrm{N}})](\frac{\mathrm{I}}{\mathrm{C}}+\Omega_{\mathrm{ELM}})^{-1}\mathrm{Y} \tag{7}\]  
Random mapping is replaced with kernel mapping, which eliminates the need to set the number of hidden layer nodes during the initialization phase. Additionally, there is no need to set the hidden layer node weights and thresholds, effectively improving the generalization ability and stability that could be compromised by random initialization of hidden layer weights. The KELM introduces kernel functions, enhancing the ELM performance when dealing with nonlinear problems.