An intelligent classified hydrological forecasting method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-07
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]本发明针对现有技术中在水文过程的不同阶段,产汇流机制不尽相同,预报因子与预报值之间的映射关系也不尽相同,单一模型描述不同水文阶段预报因子与预报值之间的高维非线性关系,难以实现精确的径流预报,模型预报结果精度低的问题,提供了一种智能分类的水文预报方法方法,更好地实现分阶段分类精细化预报
[0068] Compared with existing technologies, the beneficial technical effects of the present invention using the above technical solutions are as follows: ① The present invention simultaneously considers relevant influencing factors such as rainfall, runoff, and evaporation, which can effectively ensure the physical meaning of the forecast model; ② The present invention introduces a random term in the evolution process and performs small-amplitude perturbation calculation on the center point of the team reflection operator, which effectively improves the algorithm's ability to find the global optimum; ③ The present invention uses the k-means algorithm to divide the samples into different categories based on the forecast factors, and uses the adaptive cooperative search algorithm (ICSA) to select the initial cluster centers, which effectively improves the clustering effect and avoids the clustering iteration process from getting stuck in a local optimum due to improper selection of the initial cluster centers; ④ The present invention uses an artificial intelligence model for runoff classification forecasting and uses the adaptive cooperative search algorithm to optimize model parameters, which can fully explore the high-dimensional nonlinear mapping relationship between the input and output of different categories of sample sets, and obtain better model parameters, thereby further improving the model forecasting effect. ⑤ This invention effectively combines the advantages of classification methods, intelligent algorithms and artificial intelligence models, and has theoretical completeness and practical universality. It can obtain runoff forecasting results with higher accuracy than traditional forecasting methods, which is conducive to the innovative development of watershed flood disaster forecasting and early warning technology and the efficient utilization of water resources.
Smart Images

Figure CN117390477B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of hydrological forecasting and prediction, and specifically relates to an intelligent classification method for hydrological forecasting. Background Technology
[0002] Influenced by human activities and climate change, extreme hydrological and meteorological disasters occur frequently and are intensifying. Runoff sequences exhibit strong nonlinearity, high complexity, and non-stationarity, posing a severe challenge to traditional hydrological forecasting models. With the development of machine learning and artificial intelligence theories, intelligent data-driven models have been widely applied in the field of hydrology and have proven to have good adaptability and generalization ability. However, the runoff generation and confluence mechanisms are not the same at different stages of hydrological processes, and the mapping relationship between forecast factors and forecast values is also different. Relying solely on a single model to describe the high-dimensional nonlinear relationship between forecast factors and forecast values at different hydrological stages makes it difficult to achieve accurate runoff forecasting, greatly limiting the accuracy of model forecast results. How to consider the runoff characteristics at different stages of hydrological processes, how to integrate the runoff generation and confluence characteristics at different stages of hydrological processes with intelligent forecasting models, how to achieve stage-specific and classified refined forecasting, and how to develop higher-precision hydrological forecasting models have always been hot topics and difficulties in the field of hydrological forecasting. This is of great significance and application value for the sustainable use of water resources. Summary of the Invention
[0003] This invention addresses the problem in existing technologies where runoff generation and confluence mechanisms differ at different stages of a hydrological process, and the mapping relationship between forecast factors and forecast values also varies. A single model describing the high-dimensional nonlinear relationship between forecast factors and forecast values at different hydrological stages makes it difficult to achieve accurate runoff forecasting, resulting in low accuracy of model forecast results. This invention provides an intelligent classification hydrological forecasting method to better achieve stage-specific and refined forecasting.
[0004] To solve the above technical problems, the present invention provides the following technical solution: an intelligent classification-based hydrological forecasting method, comprising the following steps:
[0005] S1. Construct a hydrological forecast sample dataset and perform preprocessing. The hydrological forecast sample dataset includes: a forecast factor dataset composed of several influencing factors and a current flow dataset. Use the forecast factor dataset as the model input dataset and the current flow dataset as the model output dataset.
[0006] S2. Determine the number of cluster categories K, use the k-means clustering algorithm to cluster the forecast factor dataset, use the adaptive cooperative search algorithm to determine the optimal initial cluster centers, obtain the category of each sample in the forecast factor dataset, and the final cluster center; divide the training set and the test set;
[0007] S3. Construct K intelligent forecasting models using forecasting factors in the training set and current flow rate, respectively. Use the inverse of the Nash coefficient of each category forecasting result as the objective function, and use an adaptive cooperative search algorithm to select the parameters of the models to obtain the optimal intelligent forecasting models for the K categories.
[0008] S4. Using the forecast factors in the test set as input, the optimal intelligent forecast model is used to perform hydrological forecasting to obtain the forecast flow value at the current time.
[0009] Furthermore, in step S1 above, based on long-series runoff data, the Pearson correlation coefficient method is used to select D1 anterior flow rates. D2 Pre-evaporation D3 Pre-rainfall D4 other correlation factors As an influencing factor.
[0010] Furthermore, in step S1 above, the forecast factor dataset and the current-time flow dataset are obtained as follows:
[0011] For the input dataset Output dataset The input-output dataset is obtained by row normalization using equation (1). Where D is the dimension of the input variable and D = D1 + D2 + D3 + D4, and N is the number of samples in the dataset;
[0012]
[0013] In the formula, p o p′ o These represent the original data and the corresponding normalized data, respectively. These represent the maximum and minimum values of the original data, respectively.
[0014] Furthermore, the aforementioned step S2 includes the following sub-steps:
[0015] S2.0: Let the number of iterations be t=1. During the team building phase, use equation (2) to randomly generate an initial individual containing I individuals.
[0016] x i,1 =φ(0,1)·((x max -x min )+x min )i∈{1,2,...,I}#(2)
[0017] In the formula, x max and x min Normalized input sample sets The upper and lower limits,
[0018] Each individual represents one of the K initial cluster centers of the k-means algorithm. Then the i-th individual in the t-th iteration is:
[0019]
[0020] In the formula, x represents i,t The first cluster center in the middle, Let i represent the variable value of the first dimension in the first cluster center, where i∈{1,2,...,I} represents the individual label;
[0021] S2.1: For the i-th individual x i,t Set the clustering iteration count to iter = 1.
[0022] S2.2: Use equation (3) to calculate the category C of N samples;
[0023]
[0024] In the formula, For the first input factor sample and the kth cluster center Euclidean distance, The sample's Euclidean distance to the N cluster centers is sorted from smallest to largest to obtain the sample's category k;
[0025] Statistically count the samples included in the k-th category. J k Let be the number of samples in the k-th class, and have The cluster centers of each category are updated using equation (4).
[0026]
[0027] In the formula, B i,k The k-th cluster center is obtained after updating the cluster with the i-th individual as the initial cluster center. For the samples contained in the k-th category, Average(·) is the function for calculating the average value;
[0028] S2.3: Let iter = iter + 1. If iter is less than or equal to the maximum number of clustering iterations iter Ma If the cluster centers are updated, proceed to step S2.2; otherwise, stop updating and proceed to step S2.4.
[0029] S2.4: For the updated cluster centers Statistical analysis of the category of N samples Equation (5) is used to calculate the intra-class similarity as the fitness of the i-th individual, i.e., the objective function value;
[0030]
[0031] In the formula, F(·) is the fitness function. B represents the samples included in the clustering result of the k-th class. i,k The k-th cluster center is obtained after updating the i-th individual as the initial cluster center;
[0032] S2.5: Update the historical optimal decisions of I individuals and the team using equations (6)-(7);
[0033]
[0034] gbest t =argmin{F(pbest) 1,t ), F(pbest 2,t ), ..., F(pbest) I,t )}#(7)
[0035] In the formula, pbest i,t gbest represents the historical best position of the i-th individual in the t-th iteration. t This represents the team's globally optimal position in the t-th iteration;
[0036] S2.6: Calculate the team communication operator using equations (8)-(11). And during the calculation process, a random term ε that dynamically decreases with the number of iterations t is added. t To improve search performance;
[0037]
[0038]
[0039]
[0040]
[0041]
[0042] In the formula, k∈{1,2,...K} represents the cluster category, and d∈[1,D] represents the d-th dimension of the k-th initial cluster center. Let d be the value of the variable in the k-th initial cluster center after updating the i-th individual in the (t+1)-th iteration; This represents the value of the j-th variable in the k-th initial cluster center of the historical best decision of the i-th individual in the t-th iteration; Let represent the value of the j-th variable in the k-th initial cluster center of the ind-th historical best decision of the team in the t-th iteration, where ind is randomly selected from the set of integers [1, 2, ..., M], and M represents the number of historical best decisions of the team; These represent the information gains obtained from leaders, decision-makers, and supervisors, respectively; α, β, a0, and a1 represent adjustment parameters; ε t It is a random term that decreases as the number of iterations t increases;
[0043] S2.7: Using equations (12)-(15), calculate the team reflection operator. During the calculation, a random term ε is added that dynamically decreases with the number of iterations t. t Furthermore, by adding perturbations near the center point, the following was obtained.
[0044]
[0045]
[0046]
[0047]
[0048] S2.8: Using equation (16), calculate the internal competition operator.
[0049]
[0050] S2.9: Let the iteration number t = t + 1. If t is less than the maximum iteration number T, go to step 2.5; otherwise, use the optimal team decision obtained in the last iteration as the optimal initial cluster center for k-means.
[0051] S2.10: Set the clustering iteration number iter = 1, and execute step S2.2 to optimize the initial cluster centers A. * To update, set iter = iter + 1, and repeat step S2.2 until iter equals the maximum number of clustering iterations iter. Max The final cluster centers of k-means are obtained. Calculate the final category of N samples
[0052] S2.11: Divide the model input dataset and output dataset into training and test sets in a ratio of a:b, where a+b=1. And statistically analyze the categories to which the training and test sets belong.
[0053] Furthermore, as described above, step S3 includes the following sub-steps:
[0054] The k-th class of samples in the S3.0 statistical training set Samples of class k in the test set J k Let be the number of samples in the k-th class, and have
[0055] S3.1: Set the current model's preferred category k=1, and determine the hyperparameters that the forecast model needs to optimize;
[0056] S3.2: Use Constructing a forecast model k Using the adaptive cooperative search algorithm, steps S2.5 to S2.8 are performed to optimize the model parameters. Equations (17)-(20) are used to calculate the objective function and optimize the model hyperparameters.
[0057]
[0058]
[0059]
[0060]
[0061] Where, p i,t Let be the i-th individual in the t-th iteration, representing the hyperparameters that the model needs to optimize. Indicates that the hyperparameter is p i,t The forecast model, It is a forecast model The training set predictions This represents the samples of class k included in the measured values of the training set. G(·) represents the samples of class k in the predicted values of the training set, and G(·) is the objective function, representing the predicted sequence. and measured sequence The inverse value of the Nash coefficient is used as the fitness, and its minimum value is sought.
[0062] S3.3: The optimal model for preserving samples of class k.
[0063] S3.4: Let k = k + 1. If k ≤ K, then proceed to step 3.2 to select the optimal model; otherwise, end the iteration and obtain the optimal prediction model.
[0064] Furthermore, step S4 described above specifically involves: letting k ∈ {1, 2, ..., K},
[0065] For the k-th class of samples in the test set Using the k-th type optimal model Make predictions and obtain the corresponding predicted values. The predicted values of K types of samples are obtained by reordering them according to their sample numbers. Predicted values for the test set The final predicted value is obtained by performing inverse normalization. Complete the classification and forecasting.
[0066] Another aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described in the present invention.
[0067] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in the present invention.
[0068] Compared with existing technologies, the beneficial technical effects of the present invention using the above technical solutions are as follows: ① The present invention simultaneously considers relevant influencing factors such as rainfall, runoff, and evaporation, which can effectively ensure the physical meaning of the forecast model; ② The present invention introduces a random term in the evolution process and performs small-amplitude perturbation calculation on the center point of the team reflection operator, which effectively improves the algorithm's ability to find the global optimum; ③ The present invention uses the k-means algorithm to divide the samples into different categories based on the forecast factors, and uses the adaptive cooperative search algorithm (ICSA) to select the initial cluster centers, which effectively improves the clustering effect and avoids the clustering iteration process from getting stuck in a local optimum due to improper selection of the initial cluster centers; ④ The present invention uses an artificial intelligence model for runoff classification forecasting and uses the adaptive cooperative search algorithm to optimize model parameters, which can fully explore the high-dimensional nonlinear mapping relationship between the input and output of different categories of sample sets, and obtain better model parameters, thereby further improving the model forecasting effect. ⑤ This invention effectively combines the advantages of classification methods, intelligent algorithms and artificial intelligence models, and has theoretical completeness and practical universality. It can obtain runoff forecasting results with higher accuracy than traditional forecasting methods, which is conducive to the innovative development of watershed flood disaster forecasting and early warning technology and the efficient utilization of water resources. Attached Figure Description
[0069] Figure 1 This is a general framework diagram of the present invention.
[0070] Figure 2The figure shows a comparison of the forecast results of the present invention. In the figure, (a) is a flow forecast process diagram of the present invention and a single forecast method, (b) is a scatter plot of the forecast results of the single forecast method, and (c) is a scatter plot of the forecast results of the present invention. Detailed Implementation
[0071] To better understand the technical content of the present invention, specific embodiments are described below in conjunction with the accompanying drawings.
[0072] In this invention, various aspects of the invention are described with reference to the accompanying drawings, in which numerous illustrative embodiments are shown. Embodiments of the invention are not limited to those depicted in the drawings. It should be understood that the invention is implemented through any of the various concepts and embodiments described above, as well as the concepts and embodiments described in detail below, because the concepts and embodiments disclosed herein are not limited to any particular implementation. Furthermore, some aspects of the invention disclosed may be used alone or in any suitable combination with other aspects of the invention disclosed.
[0073] refer to Figure 1 This invention provides an intelligent classification method for hydrological forecasting, comprising the following steps: S1, constructing a hydrological forecasting sample dataset and performing preprocessing, wherein the hydrological forecasting sample dataset includes: a forecasting factor dataset composed of several influencing factors, and a current flow dataset; using the forecasting factor dataset as the model input dataset and the current flow dataset as the model output dataset.
[0074] Among them, based on long-series runoff data, the Pearson correlation coefficient method was used to select D1 anterior flow data points. D2 Pre-evaporation D3 Pre-rainfall D4 other correlation factors As an influencing factor.
[0075] The forecast factor dataset and the current-time flow dataset are obtained as follows:
[0076] For the input dataset Output dataset The input-output dataset is obtained by row normalization using equation (1). Where D is the dimension of the input variable and D = D1 + D2 + D3 + D4, and N is the number of samples in the dataset;
[0077]
[0078] In the formula, p o p′ o These represent the original data and the corresponding normalized data, respectively. These represent the maximum and minimum values of the original data, respectively.
[0079] S2. Determine the number of cluster categories K, use the k-means clustering algorithm to cluster the forecast factor dataset, use the adaptive cooperative search algorithm to determine the optimal initial cluster centers, obtain the category of each sample in the forecast factor dataset, and the final cluster center; divide the training set and the test set; the adaptive cooperative search algorithm is abbreviated as ICSA (Improved Cooperation Search Algorithm).
[0080] Step S2 includes the following sub-steps:
[0081] S2.0: Let the number of iterations be t=1. During the team building phase, use equation (2) to randomly generate an initial individual containing I individuals.
[0082] x i,1 =φ(0,1)·((x max -x min )+x min )i∈{1,2,...,I}#(2)
[0083] In the formula, x max and x min Normalized input sample sets The upper and lower limits,
[0084] Each individual represents one of the K initial cluster centers of the k-means algorithm. Then the i-th individual in the t-th iteration is:
[0085]
[0086] In the formula, x represents i,t The first cluster center in the middle, Let i represent the variable value of the first dimension in the first cluster center, where i∈{1,2,...,I} represents the individual label;
[0087] S2.1: For the i-th individual x i,t Set the clustering iteration count to iter = 1.
[0088] S2.2: Use equation (3) to calculate the category C of N samples;
[0089]
[0090] In the formula, For the first input factor sample and the kth cluster center Euclidean distance, The sample's Euclidean distance to the N cluster centers is sorted from smallest to largest to obtain the sample's category k;
[0091] Statistically count the samples included in the k-th category. J k Let be the number of samples in the k-th class, and have The cluster centers of each category are updated using equation (4).
[0092]
[0093] In the formula, B i,k The k-th cluster center is obtained after updating the cluster with the i-th individual as the initial cluster center. For the samples contained in the k-th category, Average(·) is the function for calculating the average value;
[0094] S2.3: Let iter = iter + 1. If iter is less than or equal to the maximum number of clustering iterations iter Max If the cluster centers are updated, proceed to step S2.2; otherwise, stop updating and proceed to step S2.4.
[0095] S2.4: For the updated cluster centers Statistical analysis of the category of N samples Equation (5) is used to calculate the intra-class similarity as the fitness of the i-th individual, i.e., the objective function value;
[0096]
[0097] In the formula, F(·) is the fitness function. B represents the samples included in the clustering result of the k-th class. i,k The k-th cluster center is obtained after updating the i-th individual as the initial cluster center;
[0098] S2.5: Update the historical optimal decisions of I individuals and the team using equations (6)-(7);
[0099]
[0100] gbest t =argmin{F(pbest) 1,t ), F(pbest 2,t ), ..., F(pbest) I,t )}#(7)
[0101] In the formula, pbest i,t gbest represents the historical best position of the i-th individual in the t-th iteration.t This represents the team's globally optimal position in the t-th iteration;
[0102] S2.6: Calculate the team communication operator using equations (8)-(11). And during the calculation process, a random term ε that dynamically decreases with the number of iterations t is added. t To improve search performance;
[0103]
[0104]
[0105]
[0106]
[0107]
[0108] In the formula, k∈{1,2,...K} represents the cluster category, and d∈[1,D] represents the d-th dimension of the k-th initial cluster center. Let d be the value of the variable in the k-th initial cluster center after updating the i-th individual in the (t+1)-th iteration; This represents the value of the j-th variable in the k-th initial cluster center of the historical best decision of the i-th individual in the t-th iteration; Let represent the value of the j-th variable in the k-th initial cluster center of the ind-th historical best decision of the team in the t-th iteration, where ind is randomly selected from the set of integers [1, 2, ..., M], and M represents the number of historical best decisions of the team; These represent the information gains obtained from leaders, decision-makers, and supervisors, respectively; α, β, a0, and a1 represent adjustment parameters; ε t It is a random term that decreases as the number of iterations t increases;
[0109] S2.7: Using equations (12)-(15), calculate the team reflection operator. During the calculation, a random term ε is added that dynamically decreases with the number of iterations t. t Furthermore, by adding perturbations near the center point, the following was obtained.
[0110]
[0111]
[0112]
[0113]
[0114] S2.8: Using equation (16), calculate the internal competition operator.
[0115]
[0116] S2.9: Let the iteration number t = t + 1. If t is less than the maximum iteration number T, go to step 2.5; otherwise, use the optimal team decision obtained in the last iteration as the optimal initial cluster center for k-means.
[0117] S2.10: Set the clustering iteration number iter = 1, and execute step S2.2 to optimize the initial cluster centers A. * To update, set iter = iter + 1, and repeat step S2.2 until iter equals the maximum number of clustering iterations iter. Max The final cluster centers of k-means are obtained. Calculate the final category of N samples
[0118] S2.11: Divide the model input dataset and output dataset into training and test sets in a ratio of a:b, where a+b=1. And statistically analyze the categories to which the training and test sets belong.
[0119] S3. Construct K intelligent forecasting models using forecasting factors in the training set and current flow rate, respectively. Use the inverse of the Nash coefficient of each category forecasting result as the objective function, and use an adaptive cooperative search algorithm to select the parameters of the models to obtain the optimal intelligent forecasting models for the K categories.
[0120] S3.0: Statistical analysis of the k-th class of samples in the training set Samples of class k in the test set J k Let be the number of samples in the k-th class, and have
[0121] S3.1: Set the current model's preferred category k=1, and determine the hyperparameters that the forecast model needs to optimize;
[0122] S3.2: Use Constructing a forecast model k Using the adaptive cooperative search algorithm, steps S2.5 to S2.8 are performed to optimize the model parameters. Equations (17)-(20) are used to calculate the objective function and optimize the model hyperparameters.
[0123]
[0124]
[0125]
[0126]
[0127] Where, p i,t Let be the i-th individual in the t-th iteration, representing the hyperparameters that the model needs to optimize. Indicates that the hyperparameter is p i,t The forecast model, It is a forecast model The training set predictions This represents the samples of class k included in the measured values of the training set. G(·) represents the samples of class k in the predicted values of the training set, and G(·) is the objective function, representing the predicted sequence. and measured sequence The inverse value of the Nash coefficient is used as the fitness, and its minimum value is sought.
[0128] S3.3: The optimal model for preserving samples of class k.
[0129] S3.4: Let k = k + 1. If k ≤ K, then proceed to step 3.2 to select the optimal model; otherwise, end the iteration and obtain the optimal prediction model. S4. Using the forecast factors in the test set as input, perform hydrological forecasting using the optimal intelligent forecasting model to obtain the forecasted flow value at the current time. Specifically, let k∈{1, 2, ..., K},
[0130] For the k-th class of samples in the test set Using the k-th type optimal model Make predictions and obtain the corresponding predicted values. The predicted values of K types of samples are obtained by reordering them according to their sample numbers. Predicted values for the test set The final predicted value is obtained by performing inverse normalization. Complete the classification and forecasting.
[0131] Taking a hydrological station as the research object, the performance of the method was tested. Runoff forecasting was performed using the classification-based intelligent forecasting method proposed in this invention and the traditional single intelligent forecasting method, and the forecast results were compared. The intelligent forecasting model used was a support vector regression machine model. Table 1 shows the statistical indicators of the forecast results of the classification-based forecasting method and the single forecasting method on the test set with a lead time of 1. C-SVM represents the single forecasting method of traditional CSA optimized SVM, and K-IC-SVM represents the method proposed in this invention. Among them, RMSE represents the root mean square error, one of the most widely used error statistics, which can effectively reflect the difference between simulated and observed values; MAE is the mean absolute error, representing the average absolute error between predicted and observed values; MAPE represents the mean absolute percentage error, an unbiased statistic that calculates relative error by comparing simulated and observed data, usually insensitive to high amplitudes but sensitive to low amplitudes; R is the correlation coefficient, which can effectively evaluate the linear relationship between predicted and observed data; NSE represents the coefficient of determination, a normalized statistic used to calculate the overall deviation between predicted and observed data.
[0132] Figure 2 The figures show the forecast results of the present invention and the single forecasting method, where (a) is a flow process diagram of the present invention and the single forecasting method, (b) is a scatter plot of the forecast results of the single forecasting method, and (c) is a scatter plot of the forecast results of the present invention. (From Table 1 and...) Figure 2 It can be seen that the present invention can effectively improve the accuracy of runoff forecasting. Compared with a single forecasting model, the present invention can more accurately depict the runoff initiation process and has a better forecasting effect for high flow values.
[0133] Table 1 Statistical Indicators of Forecast Results from Different Methods
[0134]
[0135] While the present invention has been described above with reference to preferred embodiments, it is not intended to limit the invention. Those skilled in the art can make various modifications and refinements without departing from the spirit and scope of the invention. Therefore, the scope of protection of the present invention shall be determined by the claims.
Claims
1. A method for intelligent classification-based hydrological forecasting, characterized in that, Includes the following steps: S1. Construct a hydrological forecast sample dataset and perform preprocessing. The hydrological forecast sample dataset includes: a forecast factor dataset composed of several influencing factors and a current flow dataset. Use the forecast factor dataset as the model input dataset and the current flow dataset as the model output dataset. S2. Determine the number of cluster categories K, use the k-means clustering algorithm to cluster the forecast factor dataset, use the adaptive cooperative search algorithm to determine the optimal initial cluster centers, obtain the cluster category of each sample in the forecast factor dataset, and the final cluster center; divide the training set and the test set; Specifically, it includes the following sub-steps: S2.0: Let the number of iterations be... During the team building phase, formula (2) is used to randomly generate teams containing... The initial individual of each individual; , In the formula, and Normalized input sample sets The upper and lower limits, , ; Each individual represents the initial cluster center of K clusters in k-means. Then the first The second iteration The individuals are: , In the formula, express The first cluster center in the middle, The variable value for the first dimension in the first cluster center. Indicates an individual label; S2.1: For the first individual Set the number of clustering iterations , S2.2: Use equation (3) to calculate the category of N samples. ; , In the formula, For the first input factor sample and the cluster center of the kth cluster category Euclidean distance, The sample is sorted from smallest to largest Euclidean distance to the K cluster centers to obtain the sample's category; Count the samples contained in the k-th cluster category. ,in Let be the number of samples in the k-th cluster category, and have The cluster centers of each cluster category are updated using equation (4). , , In the formula, Let the i-th individual be the initial cluster center, and then update the cluster center of the k-th cluster category. For the samples contained in the k-th cluster category, This is a function for calculating the average value; S2.3: Order ,like Less than or equal to the maximum number of clustering iterations If the cluster centers are updated, proceed to step S2.2; otherwise, stop updating and proceed to step S2.
4. S2.4: For the updated cluster centers Calculate the category of N samples. Equation (5) is used to calculate the intra-class similarity as the first... The fitness of each individual, i.e., the value of the objective function; , In the formula, For the fitness function, For the samples included in the result of the k-th cluster category, The cluster center of the k-th cluster category is obtained after updating the i-th individual as the initial cluster center; S2.5: Update using equations (6)-(7) The historical optimal decision of an individual versus the historical optimal decision of a team; , , In the formula, This represents the historical best position of the i-th individual in the t-th iteration. This represents the team's globally optimal position in the t-th iteration; S2.6: Calculate the team communication operator using equations (8)-(11). During the calculation process, a random term that dynamically decreases with the number of iterations t is added. To improve search performance; , , , , , In the formula, For clustering categories, For the first The first cluster center of the initial cluster category One dimension, Let d be the value of the variable in the cluster center of the k-th initial cluster category after updating the i-th individual in the (t+1)-th iteration; Let d represent the value of the d-th variable in the cluster center of the k-th initial cluster category of the historical best decision of the i-th individual in the t-th iteration; Let represent the value of the d-th variable in the cluster center of the k-th initial cluster category of the t-th iteration for the ind-th historical best decision of the team, where ind is randomly selected from the set of integers [1,2,…,M], and M represents the number of historical best decisions of the team; , , These represent the information gains obtained from leaders, decision-makers, and supervisors, respectively. , a0 and a1 represent adjustment parameters; It is a random term that decreases as the number of iterations t increases; S2.7: Using equations (12)-(15), calculate the team reflection operator. During the calculation, a random term that dynamically decreases with the number of iterations t is added. Furthermore, by adding perturbations near the center point, the following was obtained. ; , (13), (14), ; S2.8: Using equation (16), calculate the internal competition operator. : , S2.9: Let the number of iterations be... If t is less than the maximum number of iterations T, proceed to step 2.1; otherwise, use the optimal team decision obtained in the last iteration as the optimal initial cluster center for k-means. ; S2.10: Set the number of clustering iterations Execute step S2.2 to find the optimal initial cluster centers. Update, make Repeat step S2.2 until... Equal to the maximum number of clustering iterations The final cluster centers of k-means are obtained. Calculate the final category of N samples. ; S2.11: Divide the model input dataset and output dataset into training and test sets in a ratio of a:b, where a+b=1. , And to calculate the category to which the training set and test set belong. , ; S3. Construct K intelligent forecasting models using the forecasting factors in the training set and the current flow rate, respectively. Use the inverse of the Nash coefficient of the forecasting results of each cluster category as the objective function, and use an adaptive cooperative search algorithm to select the parameters of the models to obtain the optimal intelligent forecasting models corresponding to the K cluster categories. Specifically, it includes the following sub-steps: S3.0: Statistical analysis of the k-th class of samples in the training set: Samples from the k-th cluster in the test set ,in Let be the number of samples in the k-th cluster category, and have , ; S3.1: Set the current model category k = 1, and determine the hyperparameters that need to be optimized for the forecast model; S3.2: Use Constructing a forecast model Using the adaptive cooperative search algorithm, steps S2.5 to S2.8 are performed to optimize the model parameters. The objective function is calculated using equations (17)-(20) to determine the model hyperparameters. , , , , in, Let be the i-th individual in the t-th iteration, representing the hyperparameters that the model needs to optimize. Indicates that the hyperparameters are The forecast model, It is a forecast model The training set predictions This represents the samples contained in the k-th cluster of the measured values in the training set. This represents the samples included in the k-th cluster category in the predicted values of the training set. Let be the objective function, with and The inverse value of the Nash coefficient is used as the fitness, and its minimum value is sought. S3.3: Save the optimal model for the k-th cluster category ; S3.4: Order ,like If the result is positive, proceed to step 3.2 for optimal model selection; otherwise, end the iteration and obtain the optimal prediction model. ; S4. Using the forecast factors in the test set as input, the optimal intelligent forecast model is used to perform hydrological forecasting to obtain the forecast flow value at the current time.
2. The intelligent classification hydrological forecasting method according to claim 1, characterized in that, In step S1, based on long-series runoff data, the Pearson correlation coefficient method is used to select... Early traffic , Pre-evaporation , Previous rainfall , Other related factors As an influencing factor.
3. The intelligent classification hydrological forecasting method according to claim 2, characterized in that, In step S1, the forecast factor dataset and the current-time flow dataset are obtained as follows: For the input dataset Output dataset The input-output dataset is obtained by row normalization using equation (1). , ,in For input variable dimensions and have , The number of samples in the dataset; , In the formula, , These represent the original data and the corresponding normalized data, respectively. , These represent the maximum and minimum values of the original data, respectively.
4. The intelligent classification hydrological forecasting method according to claim 1, characterized in that, Step S4 specifically involves: Let , For the samples contained in the k-th cluster category in the test set: , using the Optimal model for each cluster category Make predictions and obtain the corresponding predicted values. Calculate the predicted values of samples contained in K clusters, and then reorder them according to their sample indices to obtain the predicted values. Predicted values for the test set The final predicted value is obtained by performing inverse normalization. Complete the classification and forecasting.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
K-means runoff year forecasting method based on particle swarm optimization
CN108647425A
Runoff forecasting method and processor
CN112686481A