CN112836864A - Weather prediction method, system, medium and electronic device - Google Patents
Weather prediction method, system, medium and electronic device Download PDFInfo
- Publication number
- CN112836864A CN112836864A CN202110061735.5A CN202110061735A CN112836864A CN 112836864 A CN112836864 A CN 112836864A CN 202110061735 A CN202110061735 A CN 202110061735A CN 112836864 A CN112836864 A CN 112836864A
- Authority
- CN
- China
- Prior art keywords
- weather
- weather prediction
- prediction method
- model
- genetic algorithm
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 67
- 230000002068 genetic effect Effects 0.000 claims abstract description 41
- 238000003066 decision tree Methods 0.000 claims abstract description 10
- 230000006870 function Effects 0.000 claims description 20
- 238000003860 storage Methods 0.000 claims description 8
- 238000011156 evaluation Methods 0.000 claims description 4
- 230000003044 adaptive effect Effects 0.000 claims description 3
- 230000008020 evaporation Effects 0.000 claims description 2
- 238000001704 evaporation Methods 0.000 claims description 2
- 238000012549 training Methods 0.000 claims description 2
- 238000005457 optimization Methods 0.000 abstract description 18
- 238000004364 calculation method Methods 0.000 abstract description 8
- 230000000694 effects Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 11
- 210000000349 chromosome Anatomy 0.000 description 8
- 238000004590 computer program Methods 0.000 description 8
- 239000002096 quantum dot Substances 0.000 description 7
- 238000004458 analytical method Methods 0.000 description 5
- 230000007547 defect Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 238000007418 data mining Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 238000004088 simulation Methods 0.000 description 4
- 230000006872 improvement Effects 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 238000011423 initialization method Methods 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 108090000623 proteins and genes Proteins 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000013277 forecasting method Methods 0.000 description 1
- 238000010191 image analysis Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000035772 mutation Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 239000013598 vector Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/10—Services
- G06Q50/26—Government or public services
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A90/00—Technologies having an indirect contribution to adaptation to climate change
- Y02A90/10—Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation
Landscapes
- Business, Economics & Management (AREA)
- Engineering & Computer Science (AREA)
- Strategic Management (AREA)
- Economics (AREA)
- Tourism & Hospitality (AREA)
- Human Resources & Organizations (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Marketing (AREA)
- Development Economics (AREA)
- General Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- Quality & Reliability (AREA)
- Game Theory and Decision Science (AREA)
- Entrepreneurship & Innovation (AREA)
- Operations Research (AREA)
- Educational Administration (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Primary Health Care (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The present disclosure provides a weather prediction method, system, medium, and electronic device, which obtains weather data of a preset time period before a current time; inputting the acquired meteorological data into a preset prediction model to obtain a weather prediction result of a preset time period after the current moment; the prediction model is based on an extreme gradient lifting algorithm integrated by a plurality of decision trees, and global search is carried out by utilizing a quantum genetic algorithm; according to the method, the extreme gradient lifting algorithm and the improved quantum genetic algorithm are combined, so that the calculation efficiency and the precision of parameter optimization are improved, and the precision of weather prediction is greatly improved.
Description
Technical Field
The present disclosure relates to the field of weather forecasting technologies, and in particular, to a weather prediction method, system, medium, and electronic device.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
Weather forecast is based on meteorological observation data and detection data, and qualitative or quantitative prediction is carried out on weather conditions of a certain area in the future by applying principles and methods such as dynamic meteorology and the like. Since the century, global climate change is abnormal. How to forecast more accurately and precaution are taken in advance, and higher requirements are provided for the short-term climate forecast mainly including the climate forecast of the time scale of the month, the season, the year and the time. The short-term climate prediction is based on the atmospheric scientific principle, and the future climate trend is predicted on the basis of researching the climate abnormal cause by means of climate dynamics, statistics and the like. Although the level of short-term forecasts is not high at present, short-term climate forecasts are an urgent need for national economic development. The weather forecast is mainly to combine the ground observation data and radar satellite observation data and to forecast the weather conditions by means of comprehensive analysis, numerical simulation and other methods. The development of weather forecast plays an important role in guaranteeing industrial, agricultural and social production. The weather forecast is generally divided into three categories with respect to age: short-term weather forecast (2-3 days), medium-term weather forecast (4-9 days), and long-term weather forecast (more than 10-15 days). Forecasting the range according to the coverage area, the weather forecast can be divided into: wide-range forecast (generally, forecast of continents or national ranges), medium-range forecast (often, forecast of provinces (districts), states and regions), and small-range forecast (e.g., forecast of a county or city).
In recent years, organizations have begun to use intelligent computing methods and data mining methods to study weather forecasts in order to improve understanding of weather laws and weather forecasting capabilities. The data mining method is based on advanced technologies in multiple subject fields, such as statistics, machine learning methods, soft computing methods, databases and other method technologies, analyzes and processes a large amount of historical data, extracts hidden, previously unknown and valuable information, and provides higher-level technical support for decision analysis. At present, data mining of weather forecast is mainly carried out by adopting a mathematical statistics method, a machine learning method and a soft computing method. Due to the characteristics of unsteady, multi-dimensional and multi-scale, sometimes empty attribute, uncertainty, periodicity and the like of meteorological data, a large forecasting error exists when the traditional forecasting method is used for analyzing and processing.
Disclosure of Invention
In order to overcome the defects of the prior art, the method, the system, the medium and the electronic equipment for weather prediction are provided, and the extreme gradient lifting algorithm and the improved quantum genetic algorithm are combined, so that the calculation efficiency and the precision of parameter optimization are improved, and the precision of weather prediction is further greatly improved.
In order to achieve the purpose, the following technical scheme is adopted in the disclosure:
a first aspect of the present disclosure provides a weather prediction method.
A weather prediction method, comprising the steps of:
acquiring meteorological data of a preset time period before the current time;
inputting the acquired meteorological data into a preset prediction model to obtain a weather prediction result of a preset time period after the current moment;
the prediction model is based on an extreme gradient lifting algorithm integrated by a plurality of decision trees, and global search is carried out by utilizing a quantum genetic algorithm.
As some possible implementations, the training of the prediction model includes the following steps:
firstly, initializing to generate a pre-designed angle sequence, and then converting the angle sequence into a population containing n individuals;
constructing according to the value of the probability amplitude in the populationWherein Is a binary string of length m, m being the number of qubits;
evaluating each individual in R (t) by using an adaptive value evaluation function, and determining the probability of the individual to be reserved according to the fitness so that each individual can have the probability corresponding to the fitness and be reserved;
and when the preset precision is reached or the preset iteration times are reached, obtaining the optimal prediction model.
As some possible implementations, in the quantum genetic algorithm, the initial population is divided into 5 sub-populations, so that the initial population can spread over the whole solution space.
As a further limitation, pi/2 is selected for sub-population division, and each sub-population initialization value is obtained.
As some possible implementation manners, in the quantum genetic algorithm, the rotation angle is dynamically adjusted by using the current evolution algebra and the maximum termination algebra according to different stages.
By way of further limitation, the rotation angle is:
wherein n is the current evolution algebra, MaxG is the maximum termination algebra, k is a constant greater than 1, and k is inversely proportional to the adjustment rate of the rotation angle.
As some possible implementations, the meteorological data is acquired by rain radar and satellite images, including at least the lowest air temperature, evaporation, insolation, humidity, and clouds measured using a time-of-day scalar.
A second aspect of the present disclosure provides a weather prediction system.
A weather projection system, comprising:
a data acquisition module configured to: acquiring meteorological data of a preset time period before the current time;
a weather prediction module configured to: inputting the acquired meteorological data into a preset prediction model to obtain a weather prediction result of a preset time period after the current moment;
the prediction model is based on an extreme gradient lifting algorithm integrated by a plurality of decision trees, and global search is carried out by utilizing a quantum genetic algorithm.
A third aspect of the present disclosure provides a computer-readable storage medium having stored thereon a program which, when executed by a processor, implements the steps in the weather prediction method according to the first aspect of the present disclosure.
A fourth aspect of the present disclosure provides an electronic device, comprising a memory, a processor, and a program stored on the memory and executable on the processor, wherein the processor implements the steps of the weather prediction method according to the first aspect of the present disclosure when executing the program.
Compared with the prior art, the beneficial effect of this disclosure is:
1. the method, the system, the medium or the electronic equipment disclosed by the disclosure utilize the combination of the extreme gradient lifting algorithm and the improved quantum genetic algorithm, so that the calculation efficiency and the precision of parameter optimization are improved, and further, the precision of weather prediction is greatly improved.
2. According to the method, the system, the medium or the electronic equipment, the improved quantum genetic algorithm is used for parameter optimization, the expandability is good, and the method can be applied to the algorithm needing parameter adjustment to achieve the optimal model prediction effect and further improve the weather prediction precision.
3. According to the method, the system, the medium or the electronic equipment, the improved quantum genetic algorithm adopts a new initialization method, so that the initial population can be distributed in the whole solution space, the defect that the probability amplitude of the basic state of the quantum is too average, so that the measurement result can be concentrated in a certain interval is avoided as much as possible, the algorithm can search from a plurality of local solution spaces simultaneously, the diversity of chromosomes is ensured, and the convergence rate of the algorithm is improved.
4. The method, the system, the medium or the electronic equipment disclosed by the disclosure dynamically adjust the rotation angle according to different stages, realize accurate search and are beneficial to finding out the optimal solution.
Advantages of additional aspects of the disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure, are incorporated in and constitute a part of this disclosure, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure and not to limit the disclosure.
Fig. 1 is a schematic flow diagram of an IQGA-XGBoost algorithm provided in embodiment 1 of the present disclosure.
Fig. 2 is a schematic diagram of adjusting n _ estimators using xgb.cv provided in embodiment 1 of the present disclosure.
Fig. 3 is a learning curve of max _ depth provided in embodiment 1 of the present disclosure.
Fig. 4 is a schematic diagram of the optimizing effect provided in embodiment 1 of the present disclosure.
FIG. 5 is a ROC curve of the IQGA-XGboost provided in example 1 of the present disclosure.
Fig. 6 is a ROC curve of the IQGA-SVM provided in embodiment 1 of the present disclosure.
Detailed Description
The present disclosure is further described with reference to the following drawings and examples.
It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the disclosure. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments according to the present disclosure. As used herein, the singular is intended to include the plural unless the context clearly dictates otherwise, and it should be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of features, steps, operations, elements, components, and/or combinations thereof.
The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
Example 1:
the embodiment 1 of the present disclosure provides a weather prediction method, including the following steps:
acquiring meteorological data of a preset time period before the current time;
inputting the acquired meteorological data into a preset prediction model to obtain a weather prediction result of a preset time period after the current moment;
the prediction model is based on an extreme gradient lifting algorithm integrated by a plurality of decision trees, and global search is carried out by utilizing a quantum genetic algorithm.
(1) Improved quantum genetic algorithm
The Quantum Genetic Algorithm (QGA) introduces the expression of quantum state vectors into genetic codes, and utilizes quantum logic gates to realize the evolution of chromosomes, which is a probability evolution algorithm combining quantum computation and genetic algorithm. In quantum computing, where information units are represented by qubits, the state of a qubit may be the 1 state, the 0 state, or a superposition of the two states, since the state of a qubit can be represented as:
|Ψ>=α|0>+β|1>
where α and β are complex numbers, representing the probability amplitude of the corresponding states:
α2+β2=1
one qubit can store and express information of two states at the same time, and one qubit string with the length of N can store and express 2 at the same timenThe different decoded chromosomes are shown below:
whereinRepresents the t th generation and the j th individual chromosome, and n is the quantum bit number of the chromosome.
The quantum revolving gate is an evolution operation execution mechanism of a quantum genetic algorithm, the revolving gate uses a general problem-independent adjustment strategy, and the adjustment operation of the quantum revolving gate is as follows:
the updating process comprises the following steps:
wherein, theta is a rotation angle,is the probability amplitude obtained after the ith quantum revolving gate of the chromosome is updated.
For thetaiThe rule of (1) is as follows:
θi=s(αi,βi)Δθi
wherein (alpha)i,βi) Representing the probability amplitude, theta, of the ith quantum bit of the chromosomeiIs the angle of rotation, s (α)i,βi) And Δ θ is the rotation direction and the rotation angle, respectively, and is valued according to a predetermined adjustment strategy.
This embodiment improves upon conventional quantum genetic algorithms by two aspects, including:
(1-1) Quantum population initialization adjustment strategy improvement
The quantum genetic algorithm represents the individuals in the population by using a quantum superposition state, so that the same population diversity is maintained and the population scale is greatly reduced compared with the classical genetic algorithm. Generally speaking, the population initialization of the quantum genetic algorithm is to encode individuals by using a formula, each gene is collapsed to |0> and |1> with equal probability, so that the initial population can be ensured to be randomly distributed in the whole solution space, but a local solution space is not searched or falls into a local optimal solution, and the purpose of optimizing cannot be rapidly completed.
To more evenly distribute the initial population throughout the overall solution space, the initial population groups may be initialized. When the traditional quantum genetic algorithm adopts a formula to encode the quantum state, the parameter theta belongs to an interval [0, 2 pi ], namely the quantum state can be positioned at any position on a unit circle in a two-dimensional space, and finally converges to one point of +/- |0> or +/- |1> through the action of a quantum revolving gate for many times.
Therefore, the present embodiment divides the initial population into 5 sub-populations, and the population initialization rule is as follows
Where θ (c _ p) represents the initialization angle of the current population, p _ s represents the population number, and c _ p represents the single tag currently being initialized.
The above formula divides the initialized population into 5 parts, so that the initial population can be spread over the whole solution space, pi/2 is selected to divide in the formula to obtain a plurality of groups of population initialization values, and division for the 2 pi interval is not selected, because if division is performed for the 2 pi interval, the initialized species population may be on a certain coordinate axis, so that the amplitude of the basic state |0> or |1> is 0, and the final observation result is a certain determined value and does not satisfy the randomness condition.
The initialization method can enable the initial population to be distributed in the whole solution space, avoids the defect that the probability amplitude of the basic states of the quantum is too even to the greatest extent, so that the measurement result is possibly concentrated in a certain interval, enables the algorithm to search from a plurality of local solution spaces simultaneously, ensures the diversity of chromosomes, and improves the convergence rate of the algorithm.
(1-2) improvement of strategy for adjusting rotation angle of quantum revolving door
Through analytical research on the traditional quantum rotating gate regulation strategy, the rotation angle is generally between 0.01 pi and 0.05 pi. Meanwhile, the same rotation angle is always adopted from the beginning to the end of optimization in the traditional quantum revolving door operation mode, which often results in low algorithm convergence speed and low accuracy. The result shows that in the early stage of optimization, a larger rotation angle is helpful for improving the global convergence speed and rapidly approaching the global optimal solution. The proper rotation angle at the middle stage of the search helps to enhance the local search capability. In the later stage of searching, a smaller rotation angle is adopted, so that the local searching capability is further improved, and the searching precision is improved. For this purpose, a dynamic angle strategy is defined and the rotation angle of the phase is dynamically adjusted according to different phases. Simulation results show that the strategy can optimize results to a great extent. The specific implementation form is as follows:
where n is the current evolutionary algebra and MaxG is the maximum termination algebra. The rate of adjustment of the rotation angle is controlled by a constant with k greater than 1, k being inversely proportional to the rate of adjustment of Δ θ. Simulation experiments show that the algorithm effect is best when the k value is between 1.3 and 2. At the final stage of algorithm optimization, the search grid becomes smaller, so that accurate search is realized, and the optimal solution can be found conveniently, as shown in the following table.
(2)XGBoost
XGboost belongs to one Boosting algorithm, and is a lifting tree model, namely a base classifier is a tree model, and the model expression is as follows:
wherein f isk(. K) denotes the kth base learner (tree model), K is its total number,is a sample xiThen, the loss objective function is set as follows:
where Ω is a regular function and the objective function is mainly composed of two parts. The first part embodies the error between the predicted and true values, where l is a loss function, the form of which is not fixed, as long as a second order derivative is satisfied. The second part is a regular term, and the specific form is as follows:
likewise, the regularization term is also composed of two parts. In the first part, T represents the number of leaf nodes, and in the second part, | w | represents the leaf weight matrix,and λ is a regular term coefficient. According to the foregoing, the newly added tree is to fit the residual error up to the last prediction, and therefore, assuming that the current t-th tree can be considered as known, the prediction result can be written as:
thus, considering only this round, the optimization objective function can be written as:
the goal is to solve for ftThe objective function of this round is minimized, and taylor second-order expansion is performed on the above equation to obtain:
where the first and second derivatives of the loss function are located, respectively. Since the previous t-1 trees have been trained, it can be regarded as a constant, and has no influence on the current round of optimization, so that the simplified objective function can be obtained:
for convenience of calculation, in this embodiment, a method of traversing leaf nodes is used instead of a method of traversing all samples, and finally, the minimum value of the optimal and objective functions is calculated:
the XGboost has 6 main parameters, different parameters have different functions, and the setting of the parameters has great influence on the model prediction effect. Parameter adjustment usually depends on empirical judgment and traversal experiments, and the traditional methods such as learning curve and grid search have the defects of low calculation efficiency, poor model effect and the like. Therefore, in the present embodiment, parameter optimization is performed based on a quantum genetic algorithm, excellent individuals of each iteration are retained, operations such as crossover, mutation and the like are performed in the excellent individuals, and excellent genes are exchanged and generated, so that the evolution is towards global optimum.
(3) IQGA-XGboost model
The xgboost (extreme Gradient Boosting) is also called extreme Gradient Boosting, and is an integrated algorithm formed by combining basis functions and weights through the Boosting idea. The XGboost algorithm has the advantages of high speed, high efficiency, strong generalization capability and the like, and is widely applied to the fields of regression and classification. The quantum genetic algorithm starts to search in the parameter space from an initial population consisting of an evenly distributed whole solution space, the individual state is represented by a quantum bit probability amplitude, the diversity of the population is enhanced, the optimizing capability is expanded, an individual with higher adaptability is selected by selecting operation-fixed probability in genetic operation for population updating, the main searching capability of the parameter space is concentrated in the part with the highest expected value by cross operation, wherein the population is updated by a quantum revolving door, the population updating means that new individual transformation is always available, the diversity of the population is enhanced, the searching range is expanded, the globally optimal solution can be better obtained compared with the genetic algorithm, and the quantum genetic algorithm only needs to calculate the adaptability value, so the parameter optimization is conveniently carried out by connecting XGboost as an intermediate variable.
The XGboost parameters are more, the adjustment is complicated, the influence of the parameters on the prediction performance of the algorithm is large, and the parameters need to be optimized. Accordingly, the embodiment provides the IQGA _ XGBoost model, based on the XGBoost integrated by multiple decision trees, the good global search capability and flexibility of the quantum genetic algorithm are utilized to make up the defects that the XGBoost model has numerous parameters, is slow in convergence and is easy to fall into local optimum, the predicted accuracy is taken as a fitness function to optimize the parameters, the overall optimization of the evolution result of each round is ensured through an elite selection strategy, and the IQGA-XGBoost algorithm flow is as follows:
(3-1) generating a pre-designed angular sequence by initialization, and then converting the angular sequence into a population containing n individualsWhereinIs an individual of the t generation in the population and has:
where m is the number of qubits, i.e. the length of the quantum chromosome, and all (i ═ 1, 2, …, m) are initially generated from the resulting angular sequence and transformed.
(3-2) constructing according to the value of the probability amplitude in P (t)WhereinIs a binary string of length m.
(3-3) evaluating each individual in R (t) by using an adaptive value evaluation function, determining the probability of the individual by using a new selection strategy through the fitness, ensuring that each individual can have the probability corresponding to the fitness to be reserved, keeping the population rich and avoiding trapping into partial optimal solution, and simultaneously ensuring that the whole population converges towards a better direction.
And (3-4) judging whether a specified precision termination condition is triggered or not, if not, continuing the following operation, and if so, outputting an optimal parameter and constructing an optimal parameter model.
And (3-5) dynamically changing the rotation angle of the quantum revolving gate according to the current iteration number, and updating the individuals by using the quantum revolving gate.
And (3-6) judging whether the set iteration number upper limit is reached, if so, outputting the optimal parameters, and constructing an optimal parameter model.
The algorithm flow of the weather prediction model based on the IQGA-XGboost is shown in figure 1.
(4) Example analysis
In order to verify the feasibility of the model, a weather data set is partially randomly sampled, a simulation experiment is carried out on software jupyter notewood, and a python3.7 version is adopted for testing.
In this embodiment, a mode combining a traditional parameter adjusting mode and an improved quantum genetic algorithm parameter adjusting mode is adopted, and parameters to be adjusted are divided into three groups according to experience and parameter adjusting difficulty, as shown in the following notation. Meanwhile, the problem that samples are unbalanced in the labels of the weather data sets is found through data searching before, and the proportion of rainy weather to non-rainy weather is about 3: 1, therefore, a class _ weight balance parameter needs to be added when building the model.
As shown in fig. 2 and 3, parameter optimization of n _ estimators and max _ depth by xgb. cv and learning curve, respectively, with n _ estimators set to 200 and max _ depth set to 3 by image analysis, is shown.
In this embodiment, the experiment is performed by comparing the IQGA-XGBoost and the IQGA-SVM (using a poly kernel function) with the Tpa-XGBoost and Tpa-SVM each using a conventional parameter adjustment (Tpa). Through the search of the traditional parameter adjusting mode, the finally determined parameters and ranges of the improved quantum genetic algorithm, XGboost and SVM to be searched are as shown in the following table.
After the range of the parameters to be searched is determined, the XGboost and the SVM are respectively optimized by using the improved quantum genetic algorithm, and the results of the traditional optimization mode are compared, so that the optimization effect is shown in figure 4.
By analyzing the fig. 4, it can be found that the prediction accuracy of the IQGA-XGBoost is inferior to the prediction effect of the optimal model searched by the XGBoost in the conventional parameter adjusting manner in the first few iterations, but exceeds the accuracy of the Tpa-XGBoost model after a few optimization times. The accuracy of the IQGA-XGboost optimal model reaches 88%, and the accuracy of the Tpa-XGboost optimal model reaches 86.7%. Meanwhile, the prediction effect of the IQGA-SVM model is 87% higher than that of the Tpa-SVM model. The analysis can also find that the performance of the IQGA-XGboost model on the weather data set is better than that of the IQGA-SVM model, the Tpa-SVM model is not as good as that of the Tpa-XGboost model, but the prediction accuracy of the IQGA-SVM model can be greatly improved and even exceeds that of the Tpa-XGboost model after the optimization of the improved quantum genetic algorithm. The list of optimal parameters determined by improving the optimization of the quantum genetic algorithm is shown in the following table.
And then modeling the XGboost model and the SVM model respectively by using the optimized optimal parameters to verify the effect of the models, wherein evaluation index ROC curves of the IQGA-XGboost model and the IQGA-SVM model are shown in figures 5 and 6, and then comparing the four models established by the IQGA-SVM, the Tpa-XGboost model and the Tpa-SVM model, and the model expression comparison results are shown in the following table.
Model (model) | Accuracy | AUC area |
IQGA-XGBoost | 88% | 0.88 |
IQGA-SVM | 87% | 0.86 |
XGBoost | 86.7% | 0.86 |
SVM | 85% | 0.85 |
The analysis of the above table shows that the IQGA-XGboost model has the best effect, and the model precision and AUC surface integral respectively reach 88% and 0.88. The accuracy and AUC area of the IQGA-SVM model reach 87% and 0.86 respectively, the weather prediction effect of the two models is very good, and the prediction accuracy of the two models is improved compared with that of the model adopting the traditional parameter adjusting mode.
According to the method, a real complex weather data set is selected as experimental data, data mining potential is enhanced through data preprocessing, then a traditional quantum genetic algorithm is improved from several directions, the global search capability and efficiency of quantum genetic algorithm heredity are effectively enhanced, then IQGA-XGboost, IQGA-SVM, Tpa-XGboost and Tpa-SVM models are respectively established on the weather data set, and classification effects of the four models are compared. In real life, the IQGA-XGboost model provided by the embodiment can efficiently and accurately predict the weather conditions of the next days only by inputting weather data of the last days, can exert the advantages of the model in short-term, medium-term and even long-term weather prediction according to different requirements, can provide reliable technical supplement for the traditional weather forecasting technology according to the prediction result, and has good academic research and engineering application popularization values.
Example 2:
an embodiment 2 of the present disclosure provides a weather prediction system, including:
a data acquisition module configured to: acquiring meteorological data of a preset time period before the current time;
a weather prediction module configured to: inputting the acquired meteorological data into a preset prediction model to obtain a weather prediction result of a preset time period after the current moment;
the prediction model is based on an extreme gradient lifting algorithm integrated by a plurality of decision trees, and global search is carried out by utilizing a quantum genetic algorithm.
The working method of the system is the same as the weather prediction method provided in embodiment 1, and details are not repeated here.
Example 3:
the embodiment 3 of the present disclosure provides a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, the method for predicting weather includes the steps of:
acquiring meteorological data of a preset time period before the current time;
inputting the acquired meteorological data into a preset prediction model to obtain a weather prediction result of a preset time period after the current moment;
the prediction model is based on an extreme gradient lifting algorithm integrated by a plurality of decision trees, and global search is carried out by utilizing a quantum genetic algorithm.
The detailed steps are the same as the weather prediction method provided in embodiment 1, and are not described again here.
Example 4:
an embodiment 4 of the present disclosure provides an electronic device, including a memory, a processor, and a program stored in the memory and capable of running on the processor, where the processor implements steps in the weather prediction method according to embodiment 1 of the present disclosure when executing the program, where the steps are:
acquiring meteorological data of a preset time period before the current time;
inputting the acquired meteorological data into a preset prediction model to obtain a weather prediction result of a preset time period after the current moment;
the prediction model is based on an extreme gradient lifting algorithm integrated by a plurality of decision trees, and global search is carried out by utilizing a quantum genetic algorithm.
The detailed steps are the same as the weather prediction method provided in embodiment 1, and are not described again here.
As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure, and various modifications and changes may be made to the present disclosure by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present disclosure should be included in the protection scope of the present disclosure.
Claims (10)
1. A weather prediction method, characterized by: the method comprises the following steps:
acquiring meteorological data of a preset time period before the current time;
inputting the acquired meteorological data into a preset prediction model to obtain a weather prediction result of a preset time period after the current moment;
the prediction model is based on an extreme gradient lifting algorithm integrated by a plurality of decision trees, and global search is carried out by utilizing a quantum genetic algorithm.
2. A weather prediction method as defined in claim 1, wherein:
training of a predictive model, comprising the steps of:
firstly, initializing to generate a pre-designed angle sequence, and then converting the angle sequence into a population containing n individuals;
constructing according to the value of the probability amplitude in the populationWherein Is a binary string of length m, m being the number of qubits;
evaluating each individual in R (t) by using an adaptive value evaluation function, and determining the probability of the individual to be reserved according to the fitness so that each individual can have the probability corresponding to the fitness and be reserved;
and when the preset precision is reached or the preset iteration times are reached, obtaining the optimal prediction model.
3. A weather prediction method as defined in claim 1, wherein:
in the quantum genetic algorithm, an initial population is divided into 5 sub-populations, so that the initial population can be spread over the whole solution space.
4. A weather prediction method as defined in claim 3, wherein:
selecting pi/2 to divide the sub-populations, and further obtaining the initialization value of each sub-population.
5. A weather prediction method as defined in claim 1, wherein:
in the quantum genetic algorithm, the rotation angle is dynamically adjusted by using the current evolution algebra and the maximum termination algebra according to different stages.
7. A weather prediction method as defined in claim 1, wherein:
the meteorological data are acquired through a rain radar and a satellite image and at least comprise the lowest air temperature, the evaporation capacity, the sunshine capacity, the humidity and the cloud capacity which are measured by utilizing a time-of-day scalar quantity.
8. A weather projection system, characterized by: the method comprises the following steps:
a data acquisition module configured to: acquiring meteorological data of a preset time period before the current time;
a weather prediction module configured to: inputting the acquired meteorological data into a preset prediction model to obtain a weather prediction result of a preset time period after the current moment;
the prediction model is based on an extreme gradient lifting algorithm integrated by a plurality of decision trees, and global search is carried out by utilizing a quantum genetic algorithm.
9. A computer-readable storage medium, on which a program is stored, which, when being executed by a processor, carries out the steps of the weather prediction method according to any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor, and a program stored on the memory and executable on the processor, wherein the processor implements the steps of the weather prediction method of any one of claims 1-7 when executing the program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110061735.5A CN112836864B (en) | 2021-01-18 | 2021-01-18 | Weather prediction method, system, medium and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110061735.5A CN112836864B (en) | 2021-01-18 | 2021-01-18 | Weather prediction method, system, medium and electronic device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112836864A true CN112836864A (en) | 2021-05-25 |
CN112836864B CN112836864B (en) | 2023-03-31 |
Family
ID=75928447
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110061735.5A Active CN112836864B (en) | 2021-01-18 | 2021-01-18 | Weather prediction method, system, medium and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112836864B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116400430A (en) * | 2023-03-23 | 2023-07-07 | 本源量子计算科技(合肥)股份有限公司 | Meteorological data prediction method and device, storage medium and electronic device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108629150A (en) * | 2018-03-16 | 2018-10-09 | 西安电子科技大学 | The RNA secondary structure prediction methods of quantum genetic algorithm based on assistance on multiple populations |
CN108876054A (en) * | 2018-07-06 | 2018-11-23 | 国网河南省电力公司郑州供电公司 | Short-Term Load Forecasting Method based on improved adaptive GA-IAGA optimization extreme learning machine |
CN110826617A (en) * | 2019-10-31 | 2020-02-21 | 中国人民公安大学 | Situation element classification method and training method and device of model thereof, and server |
CN112200353A (en) * | 2020-09-30 | 2021-01-08 | 重庆师范大学 | Support vector machine weather prediction method based on improved quantum optimization algorithm |
-
2021
- 2021-01-18 CN CN202110061735.5A patent/CN112836864B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108629150A (en) * | 2018-03-16 | 2018-10-09 | 西安电子科技大学 | The RNA secondary structure prediction methods of quantum genetic algorithm based on assistance on multiple populations |
CN108876054A (en) * | 2018-07-06 | 2018-11-23 | 国网河南省电力公司郑州供电公司 | Short-Term Load Forecasting Method based on improved adaptive GA-IAGA optimization extreme learning machine |
CN110826617A (en) * | 2019-10-31 | 2020-02-21 | 中国人民公安大学 | Situation element classification method and training method and device of model thereof, and server |
CN112200353A (en) * | 2020-09-30 | 2021-01-08 | 重庆师范大学 | Support vector machine weather prediction method based on improved quantum optimization algorithm |
Non-Patent Citations (1)
Title |
---|
谢志敏等: "基于HY-FMV模型的雷暴天气预测", 《科研信息化技术与应用》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116400430A (en) * | 2023-03-23 | 2023-07-07 | 本源量子计算科技(合肥)股份有限公司 | Meteorological data prediction method and device, storage medium and electronic device |
Also Published As
Publication number | Publication date |
---|---|
CN112836864B (en) | 2023-03-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Messner et al. | Online adaptive lasso estimation in vector autoregressive models for high dimensional wind power forecasting | |
CA2821103C (en) | Method and system for adaptive forecast of wind resources | |
CN110782658B (en) | Traffic prediction method based on LightGBM algorithm | |
Helbig et al. | Population-based metaheuristics for continuous boundary-constrained dynamic multi-objective optimisation problems | |
Wang et al. | Correlation aware multi-step ahead wind speed forecasting with heteroscedastic multi-kernel learning | |
CN112288164B (en) | Wind power combined prediction method considering spatial correlation and correcting numerical weather forecast | |
Prudius et al. | Analysis of machine learning methods to improve efficiency of big data processing in Industry 4.0 | |
CN113326969A (en) | Short-term wind speed prediction method and system based on improved whale algorithm for optimizing ELM | |
CN116128150B (en) | Photovoltaic intelligent output prediction method based on two-stage optimization | |
CN111915092A (en) | Ultra-short-term wind power prediction method based on long-time and short-time memory neural network | |
CN113673679A (en) | Cut tobacco drying process parameter selection method based on particle swarm optimization neural network | |
CN113361785A (en) | Power distribution network short-term load prediction method and device, terminal and storage medium | |
CN112836864B (en) | Weather prediction method, system, medium and electronic device | |
CN114548591A (en) | Time sequence data prediction method and system based on hybrid deep learning model and Stacking | |
CN114580763A (en) | Power load prediction method based on improved dragonfly and lightweight gradient lifting tree model | |
CN112926251B (en) | Landslide displacement high-precision prediction method based on machine learning | |
CN116993548A (en) | Incremental learning-based education training institution credit assessment method and system for LightGBM-SVM | |
CN116054144A (en) | Distribution network reconstruction method, system and storage medium for distributed photovoltaic access | |
Wu et al. | WOA-LSTM | |
CN112200353B (en) | Support vector machine weather prediction method based on improved quantum optimization algorithm | |
CN115221782A (en) | Hybrid prediction method and system for energy consumption of large public building | |
de Castro et al. | Seasonal rainfall forecast using a neo-fuzzy neuron model | |
CN114444763A (en) | Wind power prediction method based on AFSA-GNN | |
CN114202063A (en) | Fuzzy neural network greenhouse temperature prediction method based on genetic algorithm optimization | |
Azeem et al. | Rainfall Prediction Using Azure Automated Machine Learning |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |