Air quality data determination method and device, readable storage medium, and electronic device
Through the LightGBM model and Bayesian algorithm combined with WRF meteorological data and other multi-dimensional data, hyperparameters are optimized, and the accuracy and stability of air quality data determination are solved, achieving efficient and accurate acquisition of air quality data.
Patent Information
- Application Number
- CN202111486134.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2041-12-07
AI Technical Summary
The determination of air quality data has weak regularity, unstable and complex spatial and temporal dependencies, which affect the accuracy, and the hyperparameters of the model affect the calculation results, reducing the accuracy of the determination.
A method for determining air quality data is proposed. By using the LightGBM model and Bayesian algorithm, the target calculation model is constructed, hyperparameter set is configured, hyperparameters is iteratively optimized, and combined with WRF meteorological data, historical air quality data and stable weather index, it is determined. Air quality data.
It improves the accuracy and calculation performance of air quality data, ensures the accuracy and globality of hyperparameter optimization, and improves the accuracy of obtaining air quality data.
Smart Images

Figure CN114169758B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method and device for determining air quality data, a readable storage medium, and an electronic device. Background Art
[0002] At present, the air quality condition is receiving more and more attention from the general public. Poor air quality condition will not only affect people's lives, but also cause certain harm to people's physical and mental health.
[0003] The determination of air quality data involves fields such as environmental science, statistics, and computer science. In addition, the determination of air quality data has the characteristics of weak regularity, instability, easy mutation, and complex spatial and temporal dependencies, which makes the determination of air quality data difficult and affects the accuracy of air quality data. At the same time, when determining air quality data by building a model, the hyperparameters of the model will also have a certain impact on the calculation results of the model, which will further reduce the accuracy of the determination of air quality data. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art.
[0005] To this end, a first aspect of the present invention is to propose a method for determining air quality data.
[0006] A second aspect of the present invention is to provide an air quality data determination device.
[0007] A third aspect of the present invention is to provide a readable storage medium.
[0008] A fourth aspect of the present invention is to provide an electronic device.
[0009] In view of this, a first aspect of the present invention proposes a method for determining air quality data, including: determining input feature data and output data of a target calculation model, and constructing a target calculation model based on the input feature data and the output data; configuring a hyperparameter set of the target calculation model, the hyperparameter set including multiple hyperparameter groups, at least one hyperparameter having different values between different hyperparameter groups, and determining at least two hyperparameter groups in the hyperparameter set to constitute an initial hyperparameter set; determining a first target air quality data based on the initial hyperparameter set and the target calculation model, determining a first target sample based on the first target air quality data and actual air quality data, constructing a target sample set, determining a first target hyperparameter group based on a Bayesian algorithm and the target sample set, and constructing a target hyperparameter set. parameter set, and store the first target hyperparameter group and at least two hyperparameter groups in the initial hyperparameter set into the target hyperparameter set; determine the second target air quality data according to the first target hyperparameter group and the target calculation model, determine the second target sample according to the second target air quality data and the actual air quality data and update the target sample set, determine the second target hyperparameter group according to the Bayesian algorithm and the updated target sample set, and update the target hyperparameter set to complete one iteration; iterate and update the target hyperparameter set again until the number of iterations reaches a preset threshold, configure a target hyperparameter group in the target hyperparameter set as the model hyperparameter group of the target calculation model, and determine the air quality data within a first preset time period according to the configured target calculation model.
[0010] In the air quality data determination method provided by the present invention, the input characteristic data and output data of the target calculation model are determined, and the required target calculation model is constructed based on the above input characteristic data and output data.
[0011] Among them, the input characteristic data is the reference data or basis required for determining the air quality data. By obtaining various air quality reference data, the diversity of the basis for determining the air quality data is guaranteed, thereby improving the accuracy of the air quality data. Further, the output data is the air quality data within the first preset time period, and the output data corresponds to the input characteristic data. Specifically, the input characteristic data may include WRF (Weather Research And Forecasting Model) meteorological data and the calm weather index within the first preset time period, historical air quality data within the second preset time period, and site information data, and the output data includes the air quality data within the first preset time period. Among them, the calm weather index is determined by WRF meteorological data, the second preset time period is the time period before the current time, and the first preset time is the time period after the current time.
[0012] Specifically, the target calculation model is the LightGBM (Light Gradient Boosting Machine, distributed gradient boosting framework) model. The LightGBM model is a framework for implementing the GBDT (Gradient Boosting Decision Tree, gradient boosting decision tree) algorithm. The main idea of the GBDT model is to use weak classifiers (decision trees) for iterative training to obtain the optimal model. The model has the advantages of good training effect and not easy to overfit. The LightGBM model adopts strategies such as Histogram-based decision tree algorithm, GOSS (Gradient-based One-Side Sampling, one-sided gradient sampling), EFB (Exclusive Feature Bundling, exclusive feature bundling) and Leaf-wise leaf growth with depth restrictions. It not only supports efficient parallel training, but also has faster training speed, lower memory consumption, better accuracy, support for distribution, and can quickly process massive data. It can be widely used in classification and prediction problems. The air quality data determination method proposed in the present invention calculates air quality data based on the LightGBM model to ensure the rapidity and accuracy of air quality data determination.
[0013] In the air quality data determination method proposed in the present invention, further, when constructing the target calculation model, the hyperparameter set of the target calculation model will also be configured, and when starting to use the target calculation model for calculation, at least two hyperparameter groups are selected from the configured hyperparameter set to form an initial hyperparameter set.
[0014] Among them, the hyperparameter set includes multiple hyperparameters, and each hyperparameter has a certain value range. A value is selected from the value range of each hyperparameter in the multiple hyperparameters for integration to form a hyperparameter group. Different hyperparameter groups have at least one hyperparameter with different values. The number of hyperparameter groups in the hyperparameter set is determined by the value range of each hyperparameter. For example: there are three hyperparameters A, B, and C in the hyperparameter set. Hyperparameter A can take 3 values, hyperparameter B can take 2 values, and hyperparameter C can take 5 values. Then, there are 30 (3×2×5) hyperparameter groups in the hyperparameter set.
[0015] Furthermore, the hyperparameter set of the target calculation model can be configured by manually inputting the type of hyperparameter and its value range, and the value range of the hyperparameter is used to limit the calculation range when the hyperparameter is subsequently optimized. Specifically, in the air quality data determination method proposed in the present invention, the specific type and value range of the hyperparameter are configured as follows:
[0016] learning_rate: 0.01-0.1
[0017] n_estimators (number of classifiers): 100-100000;
[0018] min_gain_to_split (minimum gain to perform node splitting): 0-15;
[0019] min_child_sample (the minimum amount of data on a leaf): 20-80;
[0020] min_child_weight (minimum leaf node sample weight sum): 0.001:1;
[0021] min_data_in_leaf (the minimum number of samples in a leaf node): 200-10000;
[0022] max_depth (maximum depth of the tree): 3-12;
[0023] num_leaves (number of leaf nodes in the tree): 0-(2 max_depth –1);
[0024] Subsample (random sampling of samples): 0.8-1;
[0025] colsample_bytree (column sampling): 0.8-1.0;
[0026] reg_alpha (L1 regularization parameter): 0-100;
[0027] reg_lambda (L2 regularization parameter): 0-100.
[0028] In the air quality data determination method proposed in the present invention, further, after the initial hyperparameter set is determined, multiple hyperparameter groups in the initial hyperparameter set will be used in sequence as model hyperparameter groups of the target calculation model, and the first target air quality data corresponding to the hyperparameter group will be determined through the target calculation model, and then the first target sample will be determined based on the first target air quality data and the actual air quality data, and the target sample set will be constructed.
[0029] It can be understood that the initial hyperparameter set includes multiple hyperparameter groups, through which multiple first target air quality data and multiple first target samples can be obtained, each hyperparameter group corresponds to the first target air quality data and the first target sample, and multiple first target samples constitute the initial target sample set for subsequent calls. Further, the first target air quality data is the air quality data within a certain period of time. In order to ensure the accuracy of the calculation results of the target calculation model and the accuracy of subsequent hyperparameter optimization, when different hyperparameter groups are used as the model hyperparameter groups of the target calculation model, the consistency of the corresponding time of the first target air quality data should be maintained. Further, the first target sample is determined based on the first target air quality data and the actual air quality data, which can express the difference between the first target air quality data and the actual air quality data, that is, the first target sample is a data value that can express the accuracy of the calculation results of the target calculation model, wherein the acquisition time of the actual air quality data should be consistent with the corresponding time of the first target air quality data. The first target sample is determined based on the actual air quality data and the first target air quality data, and then the first target sample is used as reference data to optimize the hyperparameters of the target calculation model, thereby improving the accuracy of the hyperparameter optimization and thus improving the accuracy of the calculation results of the target calculation model.
[0030] In the air quality data determination method proposed in the present invention, further, after determining the initial target sample set, the first target sample in the target sample set is processed based on the Bayesian algorithm to determine a first target hyperparameter group and construct an initial target hyperparameter set.
[0031] Among them, the above-mentioned first target hyperparameter group indicates the model hyperparameter group used for the next calculation. The Bayesian optimization algorithm can use the information of the previous calculation to provide guidance for the subsequent hyperparameter selection, and search for the unknown parameter range based on the past results, so as to quickly move towards the direction of global optimization. The air quality data determination method proposed in the present invention processes the target sample set based on the Bayesian algorithm to obtain the model hyperparameter group required for the next calculation, thereby ensuring the accuracy of the model hyperparameter optimization, and thus improving the accuracy of the air quality data determination.
[0032] It is understandable that the target hyperparameter set includes the first target hyperparameter group for subsequent calls to determine the optimal hyperparameter group. In addition, to ensure the globality and comprehensiveness of hyperparameter optimization, after the target hyperparameter set is constructed, at least two hyperparameter groups in the initial hyperparameter set should be stored in the target hyperparameter set for subsequent calls. In this way, the globality and comprehensiveness of hyperparameter optimization can be guaranteed, the deviation in the determination of the optimal hyperparameter group caused by data loss can be avoided, the accuracy of hyperparameter optimization can be guaranteed, and the accuracy of the calculation results of the target calculation model can be improved.
[0033] In the air quality data determination method proposed in the present invention, further, after determining the first target hyperparameter group, the first target hyperparameter group is used as the model hyperparameter group of the target calculation model for calculation to determine the second target air quality data, and then the second target sample is determined according to the second target air quality data and the actual air quality data and the target sample set is updated. Further, in accordance with the above manner, the target samples in the updated target sample set are processed based on the Bayesian algorithm to determine a second target hyperparameter group, and the above target hyperparameter set is updated to complete an iterative update of the target hyperparameter set.
[0034] The corresponding time of the second target air quality data and the first target air quality data should be consistent to ensure the accuracy of the target calculation model calculation results and the accuracy of subsequent hyperparameter optimization. The second target hyperparameter group indicates the model hyperparameter group used for the next calculation.
[0035] In the air quality data determination method proposed in the present invention, further, the target hyperparameter set is continuously iterated and updated in the above manner until the number of iterations reaches a preset threshold. After the iteration is completed, a target hyperparameter group in the target hyperparameter set is configured as the model hyperparameter group of the target calculation model, and the air quality data within the first preset time period is determined according to the configured target calculation model. Among them, the preset threshold can be set according to the type and value range of the hyperparameter in the hyperparameter set of the target calculation model. Specifically, when there are many types of hyperparameters and a large value range, that is, when there are many hyperparameter groups in the hyperparameter set, a higher value is set as the preset threshold; when there are fewer types of hyperparameters and a smaller value range, that is, when there are fewer hyperparameter groups in the hyperparameter set, a smaller value is set as the preset threshold. The specific value of the preset threshold can be set according to the actual situation, and no specific limitation is made here.
[0036] Further, a target hyperparameter group in the target hyperparameter set is configured as a model hyperparameter group of the target computing model. It is understandable that the target hyperparameter group determined as the model hyperparameter group should be the best set of target hyperparameter groups in the target hyperparameter set. The hyperparameters of the target computing model are optimized based on the Bayesian algorithm to obtain a set of optimal hyperparameter groups, and then the target computing model is configured by the optimal hyperparameter group to determine the air quality data within the first preset time period, thereby ensuring the accuracy of the air quality data acquisition within the first time period and improving the performance of the target computing model. Among them, the first preset time period is the time period after the current time, and the first preset time period can be specifically 12 hours, 24 hours, 36 hours, 48 hours, etc. after the current time. The specific duration of the first preset time period can be set according to the actual situation, and no specific restrictions are made here.
[0037] Specifically, the air quality data within the first preset time period may include PM2.5 concentration, PM10 concentration, ozone concentration, air quality index and other air quality data that can describe the air quality status. The air quality status is reflected by various air quality data, ensuring the accuracy of the description of the air quality status. The above air quality data can be set according to actual needs and is not specifically limited here.
[0038] In summary, the air quality data determination method proposed in the present invention combines the historical air quality data in the second preset time period, the WRF meteorological data and the calm weather index in the first preset time period, the site information data and other multi-dimensional data as reference data to determine the target air quality data in the first preset time period, thereby ensuring the accuracy of the air quality data acquisition in the first preset time period. Furthermore, based on the Bayesian algorithm, the hyperparameters of the target calculation model are optimized through the historical calculation results, i.e., the target samples determined according to the target air quality data and the actual air quality data, to ensure the accuracy of the hyperparameters, improve the calculation performance of the target calculation model, and further improve the accuracy of the target air quality data acquisition.
[0039] The air quality data determination method proposed in the present invention may also have the following technical features:
[0040] In the above technical solution, preferably, the input characteristic data includes: WRF meteorological data and calm weather index within a first preset time period, historical air quality data within a second preset time period, and site information data, wherein the calm weather index is determined by WRF meteorological data; the output data includes: air quality data within the first preset time period.
[0041] Among them, the calm weather index is determined by WRF meteorological data. Specifically, the WRF meteorological data within the first preset time period may include meteorological data such as air pressure, temperature, relative humidity, wind speed, and wind direction that affect the air quality status. The historical air quality data within the second preset time period may include air quality data such as PM2.5 concentration, PM10 concentration, ozone concentration, and air quality index that can describe the air quality status. The site information feature data includes site information data such as month, weekday or weekend, hour, holiday, site ID, etc. The calm weather index is calculated by 2m relative humidity, 10m horizontal wind direction, air pressure, 24-hour temperature change, and 24-hour pressure change. The calm weather index has a greater impact on PM2.5 concentration, PM10 concentration, ozone concentration, and air quality index. Adding the calm weather index to the input feature data of the target calculation model improves the accuracy of air quality index acquisition.
[0042] Furthermore, the second preset time period is a time period before the current time, and the second preset time period may specifically be a time period of 72 hours, 100 hours, one week, one month, one year, ten years, etc. before the current time. The specific duration of the second preset time period may be set according to actual conditions, and is not specifically limited here.
[0043] It should be noted that the WRF meteorological data within the first preset time period and the historical air quality data within the second preset time period are obtained in hourly intervals to ensure the diversity, continuity and referenceability of data acquisition, thereby ensuring the accuracy of air quality index acquisition.
[0044] In any of the above technical solutions, further, the first target sample is determined based on the first target air quality data and the actual air quality data, specifically including: constructing an evaluation function, and determining the evaluation parameter values of the first target air quality data and the actual air quality data according to the evaluation function; inverting the evaluation parameter value, and determining the inverted evaluation parameter value as the first target sample.
[0045] In this technical solution, when determining the first target sample according to the first target air quality data and the actual air quality data, an evaluation function is first constructed, and the evaluation parameter values of the first target air quality data and the actual air quality data are determined according to the evaluation function, and then the evaluation parameter values are negated, and the negated evaluation parameter values are determined as the first target sample. Specifically, the evaluation function is a SMAPE (Symmetric Mean Absolute Percentage Error) evaluation function, and the evaluation function is specifically defined as:
[0046]
[0047] It should be noted that the first target air quality data is the air quality data within the first preset time period, and the first preset time period is the time period after the current time. Specifically, the first preset time period may be a time period such as 12 hours, 24 hours, 36 hours, 48 hours, etc. after the current time. It can be seen that the time span of the first target air quality data is relatively long. In actual application scenarios, the air quality data at each time point within the first preset time period is obtained at certain time intervals, and the air quality data at multiple time points constitute the first target air quality data. In other words, the first target air quality data is a collection of air quality data at multiple time points within the first preset time period, including multiple first sub-target air quality data, i.e., air quality data at each time point. Therefore, in the above evaluation function, n is the number of first sub-target air quality data contained in the first target air quality data, and F iis the specific value of the first target air quality data at a certain moment in the first preset time period, A i It is the actual air quality data at a certain moment in the first preset time period corresponding to the first target air quality data.
[0048] In addition, the first target sample can express the difference between the first target air quality data and the actual air quality data, that is, the first target sample is a data value that can express the accuracy of the calculation result of the target calculation model. Therefore, the accuracy of the first air quality data can be judged according to the above evaluation function, and then the calculation performance of the target calculation model can be evaluated.
[0049] Furthermore, it should be noted that the evaluation function is obtained by dividing the actual air quality data and the first target air quality data by the average value of the MAE (Mean Absolute Error) evaluation function. The MAE evaluation function is shown below. In this way, the above evaluation function can better evaluate the accuracy of air quality data acquisition, and then evaluate the computing performance and effect of the target calculation model, which can effectively prevent the influence of abnormal values peculiar to air quality problems on the overall evaluation score. At the same time, the first target sample is determined by the above evaluation function, and then the hyperparameters of the target calculation model are optimized by the first target sample, which improves the accuracy of hyperparameter optimization, and then improves the accuracy of the calculation results of the target calculation model.
[0050]
[0051] Where n is the number of first sub-target air quality data included in the first target air quality data, F i is the specific value of the first target air quality data at a certain moment in the first preset time period, A i It is the actual air quality data at a certain moment in the first preset time period corresponding to the first target air quality data.
[0052] In any of the above technical solutions, preferably, the first target hyperparameter group is determined according to the Bayesian algorithm and the target sample set, specifically including: according to the target sample set and the Gaussian process, fitting and calculating the expected mean and variance of the target samples of all hyperparameter groups in the hyperparameter set, and the hyperparameter group and the expected mean and variance are in a one-to-one correspondence; constructing an acquisition function based on the expected mean and variance, and based on the maximum function value of the acquisition function, determining that the hyperparameter group corresponding to the expected mean and variance corresponding to the current function value is the first target hyperparameter group; wherein the acquisition function is specifically defined as: the function value is equal to the expected mean plus 3 times the variance.
[0053] In this technical solution, based on the Gaussian process regression calculation method, the target samples in the initial target sample set are processed, and the target samples corresponding to the other hyperparameter groups in the target calculation model hyperparameter set except the initial hyperparameter set are calculated according to the existing target sample set, and then the expected mean and variance of the target samples of all hyperparameter groups in the calculation model hyperparameter set are obtained. Among them, the above hyperparameter groups and the expected mean and variance are in a one-to-one correspondence.
[0054] In the technical solution, further, a collection function based on expected mean and variance is constructed, and the expected mean and variance obtained above are substituted into the collection function for calculation to obtain multiple function values, wherein the function value and the expected mean and variance are in a one-to-one correspondence. Further, when the function value of the collection function is the largest, the expected mean and variance corresponding to the current function value are determined, and then the hyperparameter group corresponding to the expected mean and variance is determined as the first target hyperparameter group.
[0055] It can be understood that the evaluation parameter value (greater than or equal to zero) is determined according to the above-mentioned evaluation function, and then the evaluation parameter value is negated to obtain the target sample (less than or equal to zero), and the target sample can express the difference between the first target air quality data and the actual air quality data. Therefore, the larger the expected mean, the better the final expected effect of the group of hyperparameters, and the larger the variance, the greater the uncertainty of the effect of the group of hyperparameters. Among them, the point with a large expected mean is called exploration, and the point with a large variance is called exploration. By setting the ratio of the expected mean and variance, the development and exploration are weighed, and then the direction of the next optimization iteration is determined. Specifically, the ratio of the expected mean and variance is determined by defining the acquisition function, wherein the acquisition function is specifically defined as:
[0056]
[0057] Among them, x represents the hyperparameter group, X represents the set of all hyperparameter groups, that is, the hyperparameter set of the target computing model, and y t is the acquisition function value, μ t-1 (x) is the expected mean corresponding to the hyperparameter group, δ t-1 (x) is the variance corresponding to the hyperparameter group. That is to say, in the air quality data determination method proposed in the present invention, the acquisition function is specifically defined as: the function value is equal to the expected mean plus 3 times the variance. By setting the ratio of the expected mean and variance through the acquisition function, the development and exploration are weighed to determine the direction of the next optimization iteration, so that the global optimal direction can be quickly reached, ensuring the speed and accuracy of hyperparameter optimization.
[0058] It should be noted that the specific form of the acquisition function can be set according to the actual situation, which is specifically as follows:
[0059]
[0060] Among them, x represents the hyperparameter group, X represents the set of all hyperparameter groups, that is, the hyperparameter set of the target computing model, and y t is the acquisition function value, μ t-1 (x) is the expected mean corresponding to the hyperparameter group, δ t-1 (x) is the variance corresponding to the hyperparameter group. n can be assigned according to actual needs to set the expected mean and variance to different proportions.
[0061] In any of the above technical solutions, preferably, the air quality data determination method also includes: storing the expected means corresponding to at least two hyperparameter groups in the initial hyperparameter set into the target hyperparameter set; and based on the maximum function value of the acquisition function, storing the expected mean corresponding to the current function value into the target hyperparameter set.
[0062] In this technical solution, the expected means corresponding to at least two hyperparameter groups in the initial hyperparameter set are stored in the target hyperparameter set for subsequent calls to determine the optimal hyperparameter group. In this way, the globality and comprehensiveness of hyperparameter optimization can be guaranteed, the deviation in determining the optimal hyperparameter group caused by data loss can be avoided, the accuracy of hyperparameter optimization can be guaranteed, and the accuracy of the calculation results of the target calculation model can be improved.
[0063] In this technical solution, further, in an iterative update, when it is determined that the acquisition function value corresponding to a certain group of expected mean and variance is the largest, the hyperparameter group corresponding to the current function value is determined as the target hyperparameter group for the next iterative calculation of the target calculation model, and the expected mean corresponding to the current function value is stored in the target hyperparameter set for subsequent calls to determine the optimal hyperparameter group.
[0064] Therefore, the target hyperparameter set contains multiple target hyperparameter groups and multiple expected means, and the target hyperparameter groups and expected means correspond one to one to facilitate subsequent calls to the data in the target hyperparameter set.
[0065] In any of the above technical solutions, preferably, a target hyperparameter group in the target hyperparameter set is configured as the model hyperparameter group of the target computing model, specifically including: comparing the sizes of the expected means in the target hyperparameter set; based on the maximum expected mean, determining the target hyperparameter group corresponding to the expected mean as the model hyperparameter group of the target computing model.
[0066] In this technical solution, after the iteration of the target hyperparameter set is completed, the target hyperparameter set includes multiple target hyperparameter groups, and an optimal target hyperparameter group is determined from the multiple target hyperparameter groups as the model hyperparameter group of the target computing model. Specifically, the target hyperparameter set includes multiple target hyperparameter groups and multiple expected means, and the target hyperparameter groups and the expected means correspond one to one, and the expected means in the target hyperparameter set are compared, and the target hyperparameter group corresponding to the expected mean with the largest value is determined as the model hyperparameter group of the target computing model.
[0067] Among them, the expected mean is determined by the above-mentioned target sample calculation, the target sample is obtained by negating the evaluation parameter value, the evaluation parameter value is determined according to the above-mentioned evaluation function, and the evaluation parameter value is greater than or equal to zero. It can be seen that the value range of the target sample and the expected mean should be less than or equal to zero. On this basis, the target sample can express the difference between the target air quality data and the actual air quality data. Therefore, the larger the expected mean, the smaller the difference between the target air quality data and the actual air quality data, and thus the better the final expected effect of the hyperparameter group corresponding to the expected mean. The target hyperparameter group with the largest expected mean in the target hyperparameter set is selected as the model hyperparameter group of the target calculation model, which ensures the accuracy of hyperparameter optimization and thus ensures the accuracy of the calculation effect of the target calculation model.
[0068] In any of the above technical solutions, preferably, before determining the input feature data of the target calculation model, the air quality data determination method also includes: obtaining the input feature data; processing the input feature data using a random forest algorithm and a linear interpolation method to delete interference data in the input feature data and supplement missing data in the input feature data; configuring the amplitude of the input feature data based on prior knowledge.
[0069] In this technical solution, before determining the input feature data of the target calculation model, the input feature data is collected, and the collected input feature data is preprocessed by combining the random forest algorithm with the linear interpolation algorithm. Specifically, the collected input feature data is preprocessed by combining the random forest algorithm with the linear interpolation algorithm to delete the interference data in the input feature data and supplement the missing data in the input feature data, thereby ensuring the accuracy, consistency and reference of the input feature data, and thus ensuring the accuracy of the air quality index.
[0070] In this technical solution, the amplitude of the collected input feature data (i.e., the upper and lower limits of the data value) will also be configured. Specifically, the amplitude of the collected input feature data is set according to prior knowledge to ensure that the value of the input feature data can be within a reasonable range, thereby ensuring the accuracy and reference of the input feature data, and further ensuring the accuracy of the air quality index.
[0071] The second aspect of the present invention proposes an air quality data determination device, including: a construction unit, used to determine the input feature data and output data of a target calculation model, and to construct the target calculation model according to the input feature data and the output data; a processing unit, used to configure a hyperparameter set of the target calculation model, the hyperparameter set including multiple hyperparameter groups, at least one hyperparameter having different values between different hyperparameter groups, and determining at least two hyperparameter groups in the hyperparameter set to constitute an initial hyperparameter set; the processing unit is also used to determine a first target air quality data according to the initial hyperparameter set and the target calculation model, determine a first target sample according to the first target air quality data and actual air quality data, construct a target sample set, determine the first target hyperparameter group according to the Bayesian algorithm and the target sample set, and construct a target The processing unit is further used to determine the second target air quality data according to the first target hyperparameter group and the target calculation model, determine the second target sample according to the second target air quality data and the actual air quality data and update the target sample set, determine the second target hyperparameter group according to the Bayesian algorithm and the updated target sample set, and update the target hyperparameter set to complete one iteration; the processing unit is further used to iterate and update the target hyperparameter set again until the number of iterations reaches a preset threshold, configure a target hyperparameter group in the target hyperparameter set as the model hyperparameter group of the target calculation model, and determine the air quality data within a first preset time period according to the configured target calculation model.
[0072] In the air quality data determination device provided by the present invention, a construction unit is included, which is used to determine the input characteristic data and output data of the target calculation model, and construct the required target calculation model based on the above input characteristic data and output data. Among them, the input characteristic data is the reference data or basis required for determining the air quality data. By obtaining various air quality reference data, the diversity of the basis for determining the air quality data is guaranteed, thereby improving the accuracy of the air quality data determination. Furthermore, the output data is the air quality data within the first preset time period, and the output data corresponds to the input characteristic data.
[0073] Specifically, the input feature data may include WRF meteorological data and a calm weather index within a first preset time period, historical air quality data within a second preset time period, and site information data, and the output data includes air quality data within the first preset time period. The calm weather index is determined by the WRF meteorological data, the second preset time period is the time period before the current time, and the first preset time period is the time period after the current time.
[0074] Specifically, the target calculation model is the LightGBM model. The LightGBM model is a framework for implementing the GBDT algorithm. The main idea of the GBDT model is to use weak classifiers (decision trees) for iterative training to obtain the optimal model. The model has the advantages of good training effect and not easy to overfit. The LightGBM model adopts strategies such as Histogram-based decision tree algorithm, GOSS, EFB, and Leaf-wise leaf growth with depth restrictions. It not only supports efficient parallel training, but also has faster training speed, lower memory consumption, better accuracy, support for distribution, and can quickly process massive data. It can be widely used in classification and prediction problems. The air quality data determination device proposed in the present invention calculates the air quality data based on the LightGBM model, which ensures the rapidity and accuracy of the air quality data determination.
[0075] In the air quality data determination device proposed in the present invention, it further includes a processing unit for configuring the hyperparameter set of the target calculation model, and when starting to use the target calculation model for calculation, selecting at least two hyperparameter groups from the configured hyperparameter set to form an initial hyperparameter set.
[0076] Among them, the hyperparameter set includes multiple hyperparameters, and each hyperparameter has a certain value range. A value is selected from the value range of each hyperparameter in the multiple hyperparameters for integration to form a hyperparameter group. Different hyperparameter groups have at least one hyperparameter with different values. The number of hyperparameter groups in the hyperparameter set is determined by the value range of each hyperparameter. For example: there are three hyperparameters A, B, and C in the hyperparameter set. Hyperparameter A can take 3 values, hyperparameter B can take 2 values, and hyperparameter C can take 5 values. Then, there are 30 (3×2×5) hyperparameter groups in the hyperparameter set.
[0077] Furthermore, the hyperparameter set of the target calculation model can be configured by manually inputting the type of hyperparameter and its value range, and the value range of the hyperparameter is used to limit the calculation range when the hyperparameter is subsequently optimized. Specifically, in the air quality data determination device proposed in the present invention, the specific type and value range of the hyperparameter are configured as follows:
[0078] learning_rate: 0.01-0.1
[0079] n_estimators (number of classifiers): 100-100000;
[0080] min_gain_to_split (minimum gain to perform node splitting): 0-15;
[0081] min_child_sample (the minimum amount of data on a leaf): 20-80;
[0082] min_child_weight (minimum leaf node sample weight sum): 0.001:1;
[0083] min_data_in_leaf (the minimum number of samples in a leaf node): 200-10000;
[0084] max_depth (maximum depth of the tree): 3-12;
[0085] num_leaves (number of leaf nodes in the tree): 0-(2 max_depth –1);
[0086] Subsample (random sampling of samples): 0.8-1;
[0087] colsample_bytree (column sampling): 0.8-1.0;
[0088] reg_alpha (L1 regularization parameter): 0-100;
[0089] reg_lambda (L2 regularization parameter): 0-100.
[0090] In the air quality data determination device proposed in the present invention, further, after determining the initial hyperparameter set, the processing unit is also used to use multiple hyperparameter groups in the initial hyperparameter set as model hyperparameter groups of the target calculation model in sequence, and determine the first target air quality data corresponding to the hyperparameter group through the target calculation model, and then determine the first target sample based on the first target air quality data and the actual air quality data, and construct a target sample set.
[0091] It can be understood that the initial hyperparameter set includes multiple hyperparameter groups, through which multiple first target air quality data and multiple first target samples can be obtained, each hyperparameter group corresponds to the first target air quality data and the first target sample, and multiple first target samples constitute the initial target sample set for subsequent calls. Further, the first target air quality data is the air quality data within a certain period of time. In order to ensure the accuracy of the calculation results of the target calculation model and the accuracy of subsequent hyperparameter optimization, when different hyperparameter groups are used as the model hyperparameter groups of the target calculation model, the consistency of the corresponding time of the first target air quality data should be maintained. Further, the first target sample is determined based on the first target air quality data and the actual air quality data, which can express the difference between the first target air quality data and the actual air quality data, that is, the first target sample is a data value that can express the accuracy of the calculation results of the target calculation model, wherein the acquisition time of the actual air quality data should be consistent with the corresponding time of the first target air quality data. The first target sample is determined based on the actual air quality data and the first target air quality data, and then the first target sample is used as reference data to optimize the hyperparameters of the target calculation model, thereby improving the accuracy of the hyperparameter optimization and thus improving the accuracy of the calculation results of the target calculation model.
[0092] In the air quality data determination device proposed in the present invention, further, after determining the initial target sample set, the processing unit is also used to process the first target sample in the target sample set based on the Bayesian algorithm to determine a first target hyperparameter group and construct an initial target hyperparameter set.
[0093] Among them, the above-mentioned first target hyperparameter group indicates the model hyperparameter group used for the next calculation. The Bayesian optimization algorithm can use the information of the previous calculation to provide guidance for the subsequent hyperparameter selection, and search for the unknown parameter range based on the past results, so as to quickly move towards the global optimal direction. The air quality data determination device proposed in the present invention processes the target sample set based on the Bayesian algorithm to obtain the model hyperparameter group required for the next calculation, thereby ensuring the accuracy of the model hyperparameter optimization, and thus improving the accuracy of the air quality data determination.
[0094] It is understandable that the target hyperparameter set includes the first target hyperparameter group for subsequent calls to determine the optimal hyperparameter group. In addition, to ensure the globality and comprehensiveness of hyperparameter optimization, after the target hyperparameter set is constructed, at least two hyperparameter groups in the initial hyperparameter set should be stored in the target hyperparameter set for subsequent calls. In this way, the globality and comprehensiveness of hyperparameter optimization can be guaranteed, the deviation in the determination of the optimal hyperparameter group caused by data loss can be avoided, the accuracy of hyperparameter optimization can be guaranteed, and the accuracy of the calculation results of the target calculation model can be improved.
[0095] In the air quality data determination device proposed in the present invention, further, after determining the first target hyperparameter group, the processing unit is also used to: calculate the first target hyperparameter group as the model hyperparameter group of the target calculation model to determine the second target air quality data, and then determine the second target sample according to the second target air quality data and the actual air quality data and update the target sample set. Further, in accordance with the above method, the target samples in the updated target sample set are processed based on the Bayesian algorithm to determine a second target hyperparameter group, and the above target hyperparameter set is updated to complete an iterative update of the target hyperparameter set.
[0096] The corresponding time of the second target air quality data and the first target air quality data should be consistent to ensure the accuracy of the target calculation model calculation results and the accuracy of subsequent hyperparameter optimization. The second target hyperparameter group indicates the model hyperparameter group used for the next calculation.
[0097] In the air quality data determination device proposed in the present invention, further, the processing unit is also used to continuously iterate and update the target hyperparameter set in the above manner until the number of iterations reaches a preset threshold. After the iteration is completed, a target hyperparameter group in the target hyperparameter set is configured as a model hyperparameter group of the target calculation model, and the air quality data within the first preset time period is determined according to the configured target calculation model.
[0098] The preset threshold value can be set according to the type and value range of the hyperparameters in the hyperparameter set of the target computing model. Specifically, when there are many types of hyperparameters and a large value range, that is, when there are many hyperparameter groups in the hyperparameter set, a higher value is set as the preset threshold value; when there are few types of hyperparameters and a small value range, that is, when there are few hyperparameter groups in the hyperparameter set, a smaller value is set as the preset threshold value. The specific value of the preset threshold value can be set according to the actual situation and is not specifically limited here.
[0099] Further, a target hyperparameter group in the target hyperparameter set is configured as a model hyperparameter group of the target computing model. It is understandable that the target hyperparameter group determined as the model hyperparameter group should be the best set of target hyperparameter groups in the target hyperparameter set. The hyperparameters of the target computing model are optimized based on the Bayesian algorithm to obtain a set of optimal hyperparameter groups, and then the target computing model is configured by the optimal hyperparameter group to determine the air quality data within the first preset time period, thereby ensuring the accuracy of the air quality data acquisition within the first time period and improving the performance of the target computing model. Among them, the first preset time period is the time period after the current time, and the first preset time period can be specifically 12 hours, 24 hours, 36 hours, 48 hours, etc. after the current time. The specific duration of the first preset time period can be set according to the actual situation, and no specific restrictions are made here.
[0100] Specifically, the air quality data within the first preset time period may include PM2.5 concentration, PM10 concentration, ozone concentration, air quality index and other air quality data that can describe the air quality status. The air quality status is reflected by various air quality data, ensuring the accuracy of the description of the air quality status. The above air quality data can be set according to actual needs and is not specifically limited here.
[0101] In summary, the air quality data determination device proposed in the present invention combines the historical air quality data in the second preset time period, the WRF meteorological data and the calm weather index in the first preset time period, the site information data and other multi-dimensional data as reference data to determine the target air quality data in the first preset time period, thereby ensuring the accuracy of the air quality data acquisition in the first preset time period. Furthermore, based on the Bayesian algorithm, the hyperparameters of the target calculation model are optimized through the historical calculation results, i.e., the target samples determined according to the target air quality data and the actual air quality data, to ensure the accuracy of the hyperparameters, improve the calculation performance of the target calculation model, and further improve the accuracy of the target air quality data acquisition.
[0102] The third aspect of the present invention provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method for determining air quality data in any of the above-mentioned technical solutions are implemented. The readable storage medium provided by the present invention stores a program or instruction thereon, and when the program or instruction is executed by a processor, the steps of the method for determining air quality data in any of the above-mentioned technical solutions can be implemented. Therefore, the readable storage medium proposed by the present invention has all the beneficial effects of the method for determining air quality data in any of the above-mentioned technical solutions, which will not be repeated here.
[0103] Specifically, the readable storage medium may include any medium capable of storing or transmitting information. Examples of readable storage media include electronic circuits, semiconductor memory devices, read-only memory (ROM), random access memory (RAM), compact disc read-only memory (CD-ROM), flash memory, erasable ROM (EROM), magnetic tape, floppy disk, optical disk, hard disk, optical fiber medium, radio frequency (RF) link, optical data storage device, etc. The code segment may be downloaded via a computer network such as the Internet, an intranet, etc.
[0104] A fourth aspect of the present invention provides an electronic device, comprising: an air quality data determination device in any of the above technical solutions; and / or a readable storage medium in the above technical solutions.
[0105] The electronic device provided by the present invention includes the air quality data determination device in any of the above technical solutions. Therefore, it has all the beneficial effects of the air quality data determination device in any of the above technical solutions, which will not be repeated here. Furthermore, the electronic device provided by the present invention may also include the readable storage medium defined in the above technical solution. Therefore, the electronic device proposed by the present invention has all the beneficial effects of the readable storage medium defined in the above technical solution, which will not be repeated here.
[0106] Additional aspects and advantages of the present invention will become apparent from the following description or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0107] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0108] Figure 1 One of the flow charts of a method for determining air quality data according to an embodiment of the present invention is shown;
[0109] Figure 2 A second flow chart of a method for determining air quality data according to an embodiment of the present invention is shown;
[0110] Figure 3 A third flow chart of a method for determining air quality data according to an embodiment of the present invention is shown;
[0111] Figure 4 A fourth flow chart of a method for determining air quality data according to an embodiment of the present invention is shown;
[0112] Figure 5FIG5 is a flowchart of a method for determining air quality data according to an embodiment of the present invention;
[0113] Figure 6 A schematic block diagram showing an air quality data determination device according to an embodiment of the present invention;
[0114] Figure 7 A schematic block diagram of an electronic device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0115] In order to more clearly understand the above aspects, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0116] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0117] Refer to the following Figures 1 to 7 A method and apparatus for determining air quality data, an electronic device, and a readable storage medium according to some embodiments of the present invention are described.
[0118] The embodiment of the first aspect of the present invention provides a method for determining air quality data. In some embodiments of the present invention, Figure 1 As shown, the air quality data determination method includes the following steps S102 to S112.
[0119] Step S102, determining input feature data and output data of a target computing model, and constructing the target computing model according to the input feature data and the output data.
[0120] Among them, the input characteristic data is the reference data or basis required for determining the air quality data. By obtaining various air quality reference data, the diversity of the basis for determining the air quality data is guaranteed, thereby improving the accuracy of the air quality data determination. Further, the output data is the air quality data within the first preset time period, and the output data corresponds to the input characteristic data.
[0121] Specifically, the input feature data may include WRF meteorological data and a calm weather index within a first preset time period, historical air quality data within a second preset time period, and site information data, and the output data includes air quality data within the first preset time period. The calm weather index is determined by the WRF meteorological data, the second preset time period is the time period before the current time, and the first preset time period is the time period after the current time.
[0122] Further, the WRF meteorological data within the first preset time period may include meteorological data that affect the air quality status, such as air pressure, temperature, relative humidity, wind speed, and wind direction. The historical air quality data within the second preset time period may include air quality data that can describe the air quality status, such as PM2.5 concentration, PM10 concentration, ozone concentration, and air quality index. The site information feature data includes site information data such as month, weekday or weekend, hour, holiday, and site ID. The calm weather index is calculated by 2m relative humidity, 10m horizontal wind direction, air pressure, 24-hour temperature change, and 24-hour pressure change. The calm weather index has a great influence on PM2.5 concentration, PM10 concentration, ozone concentration, and air quality index. The calm weather index is added to the input feature data of the target calculation model to improve the accuracy of air quality index acquisition. Further, the first preset time period is the time period after the current time, and the first preset time period can be specifically a time period of 12 hours, 24 hours, 36 hours, 48 hours, etc. after the current time. The second preset time period is a time period before the current time, and the second preset time period may be a time period such as 72 hours, 100 hours, one week, one month, one year, or ten years before the current time. The specific durations of the first preset time period and the second preset time period may be set according to actual conditions, and are not specifically limited here.
[0123] It should be noted that the WRF meteorological data within the first preset time period and the historical air quality data within the second preset time period are obtained in hourly intervals to ensure the diversity, continuity and referenceability of data acquisition, thereby ensuring the accuracy of air quality index acquisition.
[0124] Specifically, the target calculation model is the LightGBM model. The LightGBM model is a framework for implementing the GBDT algorithm. The main idea of the GBDT model is to use weak classifiers (decision trees) for iterative training to obtain the optimal model. The model has the advantages of good training effect and not easy to overfit. The LightGBM model adopts strategies such as Histogram-based decision tree algorithm, GOSS, EFB, and Leaf-wise leaf growth with depth restrictions. It not only supports efficient parallel training, but also has faster training speed, lower memory consumption, better accuracy, support for distribution, and can quickly process massive data. It can be widely used in classification and prediction problems. The air quality data determination method proposed in the present invention calculates the air quality data based on the LightGBM model, which ensures the rapidity and accuracy of the air quality data determination.
[0125] Step S104, configuring a hyperparameter set of the target computing model, and determining that at least two hyperparameter groups in the hyperparameter set constitute an initial hyperparameter set.
[0126] Among them, the hyperparameter set includes multiple hyperparameters, and each hyperparameter has a certain value range. A value is selected from the value range of each hyperparameter in the multiple hyperparameters for integration to form a hyperparameter group. Different hyperparameter groups have at least one hyperparameter with different values. The number of hyperparameter groups in the hyperparameter set is determined by the value range of each hyperparameter. For example: there are three hyperparameters A, B, and C in the hyperparameter set. Hyperparameter A can take 3 values, hyperparameter B can take 2 values, and hyperparameter C can take 5 values. Then, there are 30 (3×2×5) hyperparameter groups in the hyperparameter set.
[0127] Furthermore, the hyperparameter set of the target calculation model can be configured by manually inputting the type of hyperparameter and its value range, and the value range of the hyperparameter is used to limit the calculation range when the hyperparameter is subsequently optimized. Specifically, in the air quality data determination method proposed in the present invention, the specific type and value range of the hyperparameter are configured as follows:
[0128] learning_rate: 0.01-0.1
[0129] n_estimators (number of classifiers): 100-100000;
[0130] min_gain_to_split (minimum gain to perform node splitting): 0-15;
[0131] min_child_sample (the minimum amount of data on a leaf): 20-80;
[0132] min_child_weight (minimum leaf node sample weight sum): 0.001:1;
[0133] min_data_in_leaf (the minimum number of samples in a leaf node): 200-10000;
[0134] max_depth (maximum depth of the tree): 3-12;
[0135] num_leaves (number of leaf nodes in the tree): 0-(2 max_depth –1);
[0136] Subsample (random sampling of samples): 0.8-1;
[0137] colsample_bytree (column sampling): 0.8-1.0;
[0138] reg_alpha (L1 regularization parameter): 0-100;
[0139] reg_lambda (L2 regularization parameter): 0-100.
[0140] Step S106, determining first target air quality data according to the initial hyperparameter set and the target calculation model, determining a first target sample according to the first target air quality data and the actual air quality data, and constructing a target sample set.
[0141] It can be understood that the initial hyperparameter set includes multiple hyperparameter groups, through which multiple first target air quality data and multiple first target samples can be obtained, each hyperparameter group corresponds to the first target air quality data and the first target sample, and multiple first target samples constitute the initial target sample set for subsequent calls. Further, the first target air quality data is the air quality data within a certain period of time. In order to ensure the accuracy of the calculation results of the target calculation model and the accuracy of subsequent hyperparameter optimization, when different hyperparameter groups are used as the model hyperparameter groups of the target calculation model, the consistency of the corresponding time of the first target air quality data should be maintained. Further, the first target sample is determined based on the first target air quality data and the actual air quality data, which can express the difference between the first target air quality data and the actual air quality data, that is, the first target sample is a data value that can express the accuracy of the calculation results of the target calculation model, wherein the acquisition time of the actual air quality data should be consistent with the corresponding time of the first target air quality data. The first target sample is determined based on the actual air quality data and the first target air quality data, and then the first target sample is used as reference data to optimize the hyperparameters of the target calculation model, thereby improving the accuracy of the hyperparameter optimization and thus improving the accuracy of the calculation results of the target calculation model.
[0142] Step S108, determining a first target hyperparameter group according to the Bayesian algorithm and the target sample set, and constructing a target hyperparameter set.
[0143] Among them, the above-mentioned first target hyperparameter group indicates the model hyperparameter group used for the next calculation. The Bayesian optimization algorithm can use the information of the previous calculation to provide guidance for the subsequent hyperparameter selection, and search for the unknown parameter range based on the past results, so as to quickly move towards the direction of global optimization. The air quality data determination method proposed in the present invention processes the target sample set based on the Bayesian algorithm to obtain the model hyperparameter group required for the next calculation, thereby ensuring the accuracy of the model hyperparameter optimization, and thus improving the accuracy of the air quality data determination.
[0144] It is understandable that the target hyperparameter set includes the first target hyperparameter group for subsequent calls to determine the optimal hyperparameter group. In addition, to ensure the globality and comprehensiveness of hyperparameter optimization, after the target hyperparameter set is constructed, at least two hyperparameter groups in the initial hyperparameter set should be stored in the target hyperparameter set for subsequent calls. In this way, the globality and comprehensiveness of hyperparameter optimization can be guaranteed, the deviation in the determination of the optimal hyperparameter group caused by data loss can be avoided, the accuracy of hyperparameter optimization can be guaranteed, and the accuracy of the calculation results of the target calculation model can be improved.
[0145] Step S110, determine the second target air quality data according to the first target hyperparameter group and the target calculation model, determine the second target sample according to the second target air quality data and the actual air quality data and update the target sample set, determine the second target hyperparameter group according to the Bayesian algorithm and the updated target sample set, and update the target hyperparameter set to complete one iteration.
[0146] The corresponding time of the second target air quality data and the first target air quality data should be consistent to ensure the accuracy of the target calculation model calculation results and the accuracy of subsequent hyperparameter optimization. The second target hyperparameter group indicates the model hyperparameter group used for the next calculation.
[0147] Step S112, iteratively update the target hyperparameter set again until the number of iterations reaches a preset threshold, configure a target hyperparameter group in the target hyperparameter set as the model hyperparameter group of the target calculation model, and determine the air quality data within the first preset time period according to the configured target calculation model.
[0148] The preset threshold value can be set according to the type and value range of the hyperparameters in the hyperparameter set of the target computing model. Specifically, when there are many types of hyperparameters and a large value range, that is, when there are many hyperparameter groups in the hyperparameter set, a higher value is set as the preset threshold value; when there are few types of hyperparameters and a small value range, that is, when there are few hyperparameter groups in the hyperparameter set, a smaller value is set as the preset threshold value. The specific value of the preset threshold value can be set according to the actual situation and is not specifically limited here.
[0149] Further, a target hyperparameter group in the target hyperparameter set is configured as a model hyperparameter group of the target computing model. It is understandable that the target hyperparameter group determined as the model hyperparameter group should be the best set of target hyperparameter groups in the target hyperparameter set. Based on the Bayesian algorithm, the hyperparameters of the target computing model are optimized to obtain a set of optimal hyperparameter groups, and then the target computing model is configured by the optimal hyperparameter group to determine the air quality data within the first preset time period, thereby ensuring the accuracy of the acquisition of air quality data within the first time period and improving the performance of the target computing model. Specifically, the air quality data within the above-mentioned first preset time period may include air quality data such as PM2.5 concentration, PM10 concentration, ozone concentration, air quality index, etc. that can describe the air quality status. The air quality status is reflected by various air quality data, which ensures the accuracy of the description of the air quality status. The above-mentioned air quality data can be set according to actual needs, and no specific restrictions are made here.
[0150] In summary, the air quality data determination method proposed in the present invention combines the historical air quality data in the second preset time period, the WRF meteorological data and the calm weather index in the first preset time period, the site information data and other multi-dimensional data as reference data to determine the target air quality data in the first preset time period, thereby ensuring the accuracy of the air quality data acquisition in the first preset time period. Furthermore, based on the Bayesian algorithm, the hyperparameters of the target calculation model are optimized through the historical calculation results, i.e., the target samples determined according to the target air quality data and the actual air quality data, to ensure the accuracy of the hyperparameters, improve the calculation performance of the target calculation model, and further improve the accuracy of the target air quality data acquisition.
[0151] In some embodiments of the present invention, Figure 2 As shown, determining the first target sample according to the first target air quality data and the actual air quality data may specifically include the following steps S202 and S204:
[0152] Step S202: construct an evaluation function, and determine evaluation parameter values of the first target air quality data and the actual air quality data according to the evaluation function.
[0153] Step S204, negate the evaluation parameter value, and determine the negated evaluation parameter value as the first target sample.
[0154] In this embodiment, when determining the first target sample according to the first target air quality data and the actual air quality data, an evaluation function is first constructed, and the evaluation parameter values of the first target air quality data and the actual air quality data are determined according to the evaluation function, and then the evaluation parameter values are negated, and the negated evaluation parameter values are determined as the first target sample. Specifically, the evaluation function is a SMAPE (Symmetric Mean Absolute Percentage Error) evaluation function, and the evaluation function is specifically defined as:
[0155]
[0156] It should be noted that the first target air quality data is the air quality data within the first preset time period, and the first preset time period may be a time period such as 12 hours, 24 hours, 36 hours, 48 hours, etc. after the current time. The time span of the first target air quality data is relatively long. In actual application scenarios, the air quality data at each time point within the first preset time period is obtained at a certain time interval, and the air quality data at multiple time points constitute the first target air quality data. In other words, the first target air quality data is a collection of air quality data at multiple time points within the first preset time period, including multiple first sub-target air quality data, i.e., air quality data at each time point.
[0157] Therefore, in the above formula, n is the number of first sub-target air quality data included in the first target air quality data, F i is the specific value of the first target air quality data at a certain moment in the first preset time period, A i It is the actual air quality data at a certain moment in the first preset time period corresponding to the first target air quality data.
[0158] In addition, the first target sample can express the difference between the first target air quality data and the actual air quality data, that is, the first target sample is a data value that can express the accuracy of the calculation result of the target calculation model. Therefore, the accuracy of the first air quality data can be judged according to the above evaluation function, and then the calculation performance of the target calculation model can be evaluated. Further, it should be noted that the evaluation function is obtained by dividing the actual air quality data and the average value of the first target air quality data on the basis of the MAE (Mean Absolute Error) evaluation function, and the MAE evaluation function is as follows. In this way, the above evaluation function can better evaluate the accuracy of air quality data acquisition, and then evaluate the calculation performance and effect of the target calculation model, which can effectively prevent the influence of abnormal values specific to air quality problems on the overall evaluation score. At the same time, the first target sample is determined by the above evaluation function, and then the hyperparameters of the target calculation model are optimized by the first target sample, which improves the accuracy of hyperparameter optimization, and then improves the accuracy of the calculation results of the target calculation model.
[0159]
[0160] Where n is the number of first sub-target air quality data included in the first target air quality data, F i is the specific value of the first target air quality data at a certain moment in the first preset time period, A i It is the actual air quality data at a certain moment in the first preset time period corresponding to the first target air quality data.
[0161] In some embodiments of the present invention, Figure 3 As shown, determining the first target hyperparameter group according to the Bayesian algorithm and the target sample set may specifically include the following steps S302 and S304:
[0162] Step S302, based on the target sample set and the Gaussian process, the expected mean and variance of the target samples of all the hyperparameter groups in the hyperparameter set are fitted and calculated.
[0163] Based on the Gaussian process regression calculation method, the target samples in the initial target sample set are processed, and the target samples corresponding to the other hyperparameter groups in the target calculation model hyperparameter set except the initial hyperparameter set are fitted and calculated according to the existing target sample set, and then the expected mean and variance of the target samples of all hyperparameter groups in the calculation model hyperparameter set are obtained. Among them, the above hyperparameter groups and the expected mean and variance are in a one-to-one correspondence.
[0164] Step S304, constructing an acquisition function based on the expected mean and variance, based on the maximum function value of the acquisition function, determining the hyperparameter group corresponding to the expected mean and variance corresponding to the current function value as the first target hyperparameter group.
[0165] Construct an acquisition function based on the expected mean and variance, substitute the expected mean and variance obtained above into the acquisition function to calculate and obtain multiple function values, wherein the function value and the expected mean and variance are in a one-to-one correspondence. Further, when the function value of the acquisition function is the largest, determine the expected mean and variance corresponding to the current function value, and then determine the hyperparameter group corresponding to the expected mean and variance as the first target hyperparameter group.
[0166] It can be understood that the evaluation parameter value (greater than or equal to zero) is determined according to the above-mentioned evaluation function, and then the evaluation parameter value is negated to obtain the target sample (less than or equal to zero), and the target sample can express the difference between the first target air quality data and the actual air quality data. Therefore, the larger the expected mean, the better the final expected effect of the group of hyperparameters, and the larger the variance, the greater the uncertainty of the effect of the group of hyperparameters. Among them, the point with a large expected mean is called exploration, and the point with a large variance is called exploration. By setting the ratio of the expected mean and variance, the development and exploration are weighed, and then the direction of the next optimization iteration is determined. Specifically, the ratio of the expected mean and variance is determined by defining the acquisition function, wherein the acquisition function is specifically defined as:
[0167]
[0168] Among them, x represents the hyperparameter group, X represents the set of all hyperparameter groups, that is, the hyperparameter set of the target computing model, and y t is the acquisition function value, μ t-1 (x) is the expected mean corresponding to the hyperparameter group, δ t-1 (x) is the variance corresponding to the hyperparameter group. That is to say, in the air quality data determination method proposed in the present invention, the acquisition function is specifically defined as: the function value is equal to the expected mean plus 3 times the variance. By setting the ratio of the expected mean and variance through the acquisition function, the development and exploration are weighed to determine the direction of the next optimization iteration, so that the global optimal direction can be quickly reached, ensuring the speed and accuracy of hyperparameter optimization.
[0169] It should be noted that the specific form of the acquisition function can be set according to the actual situation, which is specifically as follows:
[0170]
[0171] Among them, x represents the hyperparameter group, X represents the set of all hyperparameter groups, that is, the hyperparameter set of the target computing model, and y t is the acquisition function value, μ t-1 (x) is the expected mean corresponding to the hyperparameter group, δ t-1 (x) is the variance corresponding to the hyperparameter group. n can be assigned according to actual needs to set the expected mean and variance to different proportions.
[0172] In some embodiments of the present invention, further, the air quality data determination method also includes: storing the expected means corresponding to at least two hyperparameter groups in the initial hyperparameter set into the target hyperparameter set; and based on the maximum function value of the acquisition function, storing the expected mean corresponding to the current function value into the target hyperparameter set.
[0173] Among them, the expected means corresponding to at least two hyperparameter groups in the initial hyperparameter set are stored in the target hyperparameter set for subsequent calls to determine the optimal hyperparameter group. In this way, the globality and comprehensiveness of hyperparameter optimization can be guaranteed, the deviation in the determination of the optimal hyperparameter group caused by data loss can be avoided, the accuracy of hyperparameter optimization can be guaranteed, and the accuracy of the calculation results of the target calculation model can be improved. Furthermore, in an iterative update, when it is determined that the acquisition function value corresponding to a certain group of expected means and variances is the largest, the hyperparameter group corresponding to the current function value is determined as the target hyperparameter group for the next iterative calculation of the target calculation model, and the expected mean corresponding to the current function value is stored in the target hyperparameter set for subsequent calls to determine the optimal hyperparameter group.
[0174] Therefore, the target hyperparameter set contains multiple target hyperparameter groups and multiple expected means, and the target hyperparameter groups and expected means correspond one to one to facilitate subsequent calls to the data in the target hyperparameter set.
[0175] In some embodiments of the present invention, Figure 4 As shown, a target hyperparameter group in the above configuration target hyperparameter set is a model hyperparameter group of the target computing model, which may specifically include the following steps S402 and S404:
[0176] Step S402, comparing the expected means in the target hyperparameter set.
[0177] Step S404, based on the maximum expected mean, determining the target hyperparameter group corresponding to the expected mean as the model hyperparameter group of the target computing model.
[0178] Specifically, after the iteration of the target hyperparameter set is completed, the target hyperparameter set includes multiple target hyperparameter groups and multiple expected means, and the target hyperparameter groups and expected means correspond one to one. The sizes of the expected means in the target hyperparameter set are compared, and the target hyperparameter group corresponding to the expected mean with the largest value is determined as the model hyperparameter group of the target calculation model.
[0179] Among them, the expected mean is determined by the above-mentioned target sample calculation, the target sample is obtained by negating the evaluation parameter value, the evaluation parameter value is determined according to the above-mentioned evaluation function, and the evaluation parameter value is greater than or equal to zero. It can be seen that the value range of the target sample and the expected mean should be less than or equal to zero. On this basis, the target sample can express the difference between the target air quality data and the actual air quality data. Therefore, the larger the expected mean, the smaller the difference between the target air quality data and the actual air quality data, and thus the better the final expected effect of the hyperparameter group corresponding to the expected mean. The target hyperparameter group with the largest expected mean in the target hyperparameter set is selected as the model hyperparameter group of the target calculation model, which ensures the accuracy of hyperparameter optimization and thus ensures the accuracy of the calculation effect of the target calculation model.
[0180] In some embodiments of the present invention, Figure 5 As shown, before determining the input characteristic data of the target calculation model, the air quality data determination method may further include the following steps S502 to S506:
[0181] Step S502, obtaining input feature data.
[0182] Step S504, using a random forest algorithm and a linear interpolation method to process the input feature data, so as to delete interference data in the input feature data and supplement missing data in the input feature data.
[0183] Before determining the input feature data of the target calculation model, the above input feature data will be collected, and the collected input feature data will be preprocessed by combining the random forest algorithm with the linear interpolation algorithm. Specifically, the collected input feature data is preprocessed by combining the random forest algorithm with the linear interpolation algorithm to delete the interference data in the input feature data and supplement the missing data in the input feature data, thereby ensuring the accuracy, consistency and reference of the input feature data, and thus ensuring the accuracy of the air quality index.
[0184] Step S506, configuring the amplitude of the input feature data according to prior knowledge.
[0185] In this embodiment, the amplitude of the collected input feature data (i.e., the upper and lower limits of the data value) is also configured. Specifically, the amplitude of the collected input feature data is set according to prior knowledge to ensure that the value of the input feature data can be within a reasonable interval, thereby ensuring the accuracy and reference of the input feature data, and further ensuring the accuracy of the air quality index.
[0186] The embodiment of the second aspect of the present invention provides an air quality data determination device. In some embodiments of the present invention, such as Figure 6 As shown, an air quality data determination device 600 is proposed, and the air quality data determination device 600 includes:
[0187] A construction unit 602 is used to determine input feature data and output data of a target computing model, and to construct the target computing model according to the input feature data and the output data;
[0188] Processing unit 604 is used to configure a hyperparameter set of a target computing model, where the hyperparameter set includes multiple hyperparameter groups, where different hyperparameter groups have different values of at least one hyperparameter, and determine that at least two hyperparameter groups in the hyperparameter set constitute an initial hyperparameter set;
[0189] The processing unit 604 is further configured to determine first target air quality data according to the initial hyperparameter set and the target calculation model, determine a first target sample according to the first target air quality data and the actual air quality data, construct a target sample set, determine a first target hyperparameter group according to the Bayesian algorithm and the target sample set, and construct a target hyperparameter set;
[0190] The processing unit 604 is further configured to determine the second target air quality data according to the first target hyperparameter group and the target calculation model, determine the second target sample according to the second target air quality data and the actual air quality data and update the target sample set, determine the second target hyperparameter group according to the Bayesian algorithm and the updated target sample set, and update the target hyperparameter set to complete one iteration;
[0191] Processing unit 604 is also used to iteratively update the target hyperparameter set again until the number of iterations reaches a preset threshold, configure a target hyperparameter group in the target hyperparameter set as a model hyperparameter group of the target calculation model, and determine the air quality data within a first preset time period according to the configured target calculation model.
[0192] In the air quality data determination device 600 provided by the present invention, a construction unit 602 is included, which is used to determine the input characteristic data and output data of the target calculation model, and to construct the required target calculation model based on the above input characteristic data and output data. Among them, the input characteristic data is the reference data or basis required for determining the air quality data. By obtaining various air quality reference data, the diversity of the basis for determining the air quality data is guaranteed, thereby improving the accuracy of the air quality data determination. Furthermore, the output data is the air quality data within the first preset time period, and the output data corresponds to the input characteristic data.
[0193] Specifically, the input feature data may include WRF meteorological data and a calm weather index within a first preset time period, historical air quality data within a second preset time period, and site information data, and the output data includes air quality data within the first preset time period. The calm weather index is determined by the WRF meteorological data, the second preset time period is the time period before the current time, and the first preset time period is the time period after the current time.
[0194] Specifically, the target calculation model is the LightGBM model. The LightGBM model is a framework for implementing the GBDT algorithm. The main idea of the GBDT model is to use weak classifiers (decision trees) for iterative training to obtain the optimal model. The model has the advantages of good training effect and not easy to overfit. The LightGBM model adopts strategies such as Histogram-based decision tree algorithm, GOSS, EFB, and Leaf-wise leaf growth with depth restrictions. It not only supports efficient parallel training, but also has faster training speed, lower memory consumption, better accuracy, support for distribution, and can quickly process massive data. It can be widely used in classification and prediction problems. The air quality data determination device 600 proposed in the present invention calculates the air quality data based on the LightGBM model, which ensures the rapidity and accuracy of the air quality data determination.
[0195] In the air quality data determination device 600 proposed in the present invention, it further includes a processing unit 604, which is used to configure the hyperparameter set of the target calculation model, and when starting to use the target calculation model for calculation, select at least two hyperparameter groups from the configured hyperparameter set to form an initial hyperparameter set.
[0196] Among them, the hyperparameter set includes multiple hyperparameters, and each hyperparameter has a certain value range. A value is selected from the value range of each hyperparameter in the multiple hyperparameters for integration to form a hyperparameter group. Different hyperparameter groups have at least one hyperparameter with different values. The number of hyperparameter groups in the hyperparameter set is determined by the value range of each hyperparameter. For example: there are three hyperparameters A, B, and C in the hyperparameter set. Hyperparameter A can take 3 values, hyperparameter B can take 2 values, and hyperparameter C can take 5 values. Then, there are 30 (3×2×5) hyperparameter groups in the hyperparameter set.
[0197] Furthermore, the hyperparameter set of the target calculation model can be configured by manually inputting the type of the hyperparameter and its value range, and the value range of the hyperparameter is used to limit the calculation range when the hyperparameter is subsequently optimized. In the air quality data determination device 600 proposed in the present invention, the specific type and value range of the hyperparameter are configured as follows:
[0198] learning_rate: 0.01-0.1
[0199] n_estimators (number of classifiers): 100-100000;
[0200] min_gain_to_split (minimum gain to perform node splitting): 0-15;
[0201] min_child_sample (the minimum amount of data on a leaf): 20-80;
[0202] min_child_weight (minimum leaf node sample weight sum): 0.001:1;
[0203] min_data_in_leaf (the minimum number of samples in a leaf node): 200-10000;
[0204] max_depth (maximum depth of the tree): 3-12;
[0205] num_leaves (number of leaf nodes in the tree): 0-(2 max_depth –1);
[0206] Subsample (random sampling of samples): 0.8-1;
[0207] colsample_bytree (column sampling): 0.8-1.0;
[0208] reg_alpha (L1 regularization parameter): 0-100;
[0209] reg_lambda (L2 regularization parameter): 0-100.
[0210] In the air quality data determination device 600 proposed in the present invention, after determining the initial hyperparameter set, the processing unit 604 is also used to use multiple hyperparameter groups in the initial hyperparameter set as model hyperparameter groups of the target calculation model in sequence, and determine the first target air quality data corresponding to the hyperparameter group through the target calculation model, and then determine the first target sample based on the first target air quality data and the actual air quality data, and construct a target sample set.
[0211] It is understandable that the initial hyperparameter set includes multiple hyperparameter groups, through which multiple first target air quality data and multiple first target samples can be obtained, each hyperparameter group corresponds to the first target air quality data and the first target sample, and multiple first target samples constitute the initial target sample set for subsequent calls. Further, the first target air quality data is the air quality data within the first preset time period, and the first preset time period can be specifically 12 hours, 24 hours, 36 hours, 48 hours, etc. after the current time. In order to ensure the accuracy of the calculation results of the target calculation model and the accuracy of subsequent hyperparameter optimization, when different hyperparameter groups are used as the model hyperparameter groups of the target calculation model, the consistency of the corresponding time of the first target air quality data should be maintained. Further, the first target sample is determined based on the first target air quality data and the actual air quality data, which can express the difference between the first target air quality data and the actual air quality data, that is, the first target sample is a data value that can express the accuracy of the calculation results of the target calculation model, wherein the acquisition time of the actual air quality data should be consistent with the corresponding time of the first target air quality data. The first target sample is determined based on the actual air quality data and the first target air quality data, and then the first target sample is used as reference data to optimize the hyperparameters of the target calculation model, thereby improving the accuracy of the hyperparameter optimization and thus improving the accuracy of the calculation results of the target calculation model.
[0212] In the air quality data determination device 600 proposed in the present invention, further, after determining the initial target sample set, the processing unit 604 is also used to process the first target sample in the target sample set based on the Bayesian algorithm to determine a first target hyperparameter group and construct an initial target hyperparameter set.
[0213] Among them, the above-mentioned first target hyperparameter group indicates the model hyperparameter group used for the next calculation. The Bayesian optimization algorithm can use the information of the previous calculation to provide guidance for the subsequent hyperparameter selection, and search for the unknown parameter range based on the past results, so as to quickly move towards the direction of global optimization. The air quality data determination device 600 proposed in the present invention processes the target sample set based on the Bayesian algorithm to obtain the model hyperparameter group required for the next calculation, thereby ensuring the accuracy of the model hyperparameter optimization, and thus improving the accuracy of the air quality data determination.
[0214] It is understandable that the target hyperparameter set includes the first target hyperparameter group for subsequent calls to determine the optimal hyperparameter group. In addition, to ensure the globality and comprehensiveness of hyperparameter optimization, after the target hyperparameter set is constructed, at least two hyperparameter groups in the initial hyperparameter set should be stored in the target hyperparameter set for subsequent calls. In this way, the globality and comprehensiveness of hyperparameter optimization can be guaranteed, the deviation in the determination of the optimal hyperparameter group caused by data loss can be avoided, the accuracy of hyperparameter optimization can be guaranteed, and the accuracy of the calculation results of the target calculation model can be improved.
[0215] In the air quality data determination device 600 proposed in the present invention, further, after determining the first target hyperparameter group, the processing unit 604 is also used to: calculate the first target hyperparameter group as the model hyperparameter group of the target calculation model to determine the second target air quality data, and then determine the second target sample according to the second target air quality data and the actual air quality data and update the target sample set. Further, in the above manner, the target samples in the updated target sample set are processed based on the Bayesian algorithm to determine a second target hyperparameter group, and the above target hyperparameter set is updated to complete an iterative update of the target hyperparameter set.
[0216] The corresponding time of the second target air quality data and the first target air quality data should be consistent to ensure the accuracy of the target calculation model calculation results and the accuracy of subsequent hyperparameter optimization. The second target hyperparameter group indicates the model hyperparameter group used for the next calculation.
[0217] In the air quality data determination device 600 proposed in the present invention, the processing unit 604 is also used to continuously iterate and update the target hyperparameter set in the above manner until the number of iterations reaches a preset threshold. After the iteration is completed, a target hyperparameter group in the target hyperparameter set is configured as the model hyperparameter group of the target calculation model, and the air quality data within the first preset time period is determined according to the configured target calculation model. Among them, the preset threshold can be set according to the type and value range of the hyperparameter in the hyperparameter set of the target calculation model. Specifically, when there are many types of hyperparameters and a large value range, that is, when there are many hyperparameter groups in the hyperparameter set, a higher value is set as the preset threshold; when there are fewer types of hyperparameters and a smaller value range, that is, when there are fewer hyperparameter groups in the hyperparameter set, a smaller value is set as the preset threshold. The specific value of the preset threshold can be set according to the actual situation, and no specific restriction is made here.
[0218] Further, a target hyperparameter group in the target hyperparameter set is configured as a model hyperparameter group of the target computing model. It is understandable that the target hyperparameter group determined as the model hyperparameter group should be the best set of target hyperparameter groups in the target hyperparameter set. The hyperparameters of the target computing model are optimized based on the Bayesian algorithm to obtain a set of optimal hyperparameter groups, and then the target computing model is configured by the optimal hyperparameter group to determine the air quality data within the first preset time period, thereby ensuring the accuracy of the air quality data acquisition within the first time period and improving the performance of the target computing model. Among them, the first preset time period is the time period after the current time, and the first preset time period can be specifically 12 hours, 24 hours, 36 hours, 48 hours, etc. after the current time. The specific duration of the first preset time period can be set according to the actual situation, and no specific restrictions are made here.
[0219] Specifically, the air quality data within the first preset time period may include PM2.5 concentration, PM10 concentration, ozone concentration, air quality index and other air quality data that can describe the air quality status. The air quality status is reflected by various air quality data, ensuring the accuracy of the description of the air quality status. The above air quality data can be set according to actual needs and is not specifically limited here.
[0220] In summary, the air quality data determination device 600 proposed in the present invention combines the historical air quality data in the second preset time period, the WRF meteorological data and the calm weather index in the first preset time period, the site information data and other multi-dimensional data as reference data to determine the target air quality data in the first preset time period, thereby ensuring the accuracy of the air quality data acquisition in the first preset time period. Furthermore, based on the Bayesian algorithm, the hyperparameters of the target calculation model are optimized through the historical calculation results, i.e., the target samples determined according to the target air quality data and the actual air quality data, to ensure the accuracy of the hyperparameters, improve the calculation performance of the target calculation model, and further improve the accuracy of the target air quality data acquisition.
[0221] In some embodiments of the present invention, optionally, the above-mentioned input characteristic data include: WRF meteorological data and calm weather index within the second preset time period, historical air quality data within the first preset time period, and site information data, wherein the calm weather index is determined by the WRF meteorological data; the output data includes: air quality data within the first preset time period.
[0222] In some embodiments of the present invention, optionally, the processing unit 604 can be specifically used to: construct an evaluation function, determine the evaluation parameter values of the first target air quality data and the actual air quality data according to the evaluation function; negate the evaluation parameter value, and determine the negated evaluation parameter value as the first target sample.
[0223] In some embodiments of the present invention, optionally, the processing unit 604 can also be used to: fit and calculate the expected mean and variance of the target samples of all hyperparameter groups in the hyperparameter set according to the target sample set and the Gaussian process, and the hyperparameter group and the expected mean and variance are in a one-to-one correspondence; construct an acquisition function based on the expected mean and variance, and based on the maximum function value of the acquisition function, determine that the hyperparameter group corresponding to the expected mean and variance corresponding to the current function value is the first target hyperparameter group; wherein the acquisition function is specifically defined as: the function value is equal to the expected mean plus 3 times the variance.
[0224] In some embodiments of the present invention, optionally, the processing unit 604 is also used to store the expected means corresponding to at least two hyperparameter groups in the initial hyperparameter set into the target hyperparameter set; and based on the maximum function value of the acquisition function, store the expected mean corresponding to the current function value into the target hyperparameter set.
[0225] In some embodiments of the present invention, optionally, the processing unit 604 can also be used to: compare the sizes of the expected means in the target hyperparameter set; based on the maximum expected mean, determine the target hyperparameter group corresponding to the expected mean as the model hyperparameter group of the target computing model.
[0226] In some embodiments of the present invention, optionally, the air quality data determination device 600 also includes: an acquisition unit for acquiring input feature data; the processing unit 604 is also used to: process the input feature data using a random forest algorithm and a linear interpolation method to delete interference data in the input feature data and supplement missing data in the input feature data; and configure the amplitude of the input feature data according to prior knowledge.
[0227] The embodiment of the third aspect of the present invention provides a readable storage medium. In some embodiments of the present invention, a readable storage medium is proposed, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the air quality data determination method in any of the above embodiments are implemented. Therefore, the readable storage medium proposed in this embodiment has all the beneficial effects of the air quality data determination method in any of the above embodiments, which will not be repeated here.
[0228] In a specific embodiment, the readable storage medium may include any medium capable of storing or transmitting information. Examples of readable storage media include electronic circuits, semiconductor memory devices, read-only memory (ROM), random access memory (RAM), compact disc read-only memory (CD-ROM), flash memory, erasable ROM (EROM), magnetic tape, floppy disk, optical disk, hard disk, optical fiber medium, radio frequency (RF) link, optical data storage device, etc. The code segment may be downloaded via a computer network such as the Internet, an intranet, etc.
[0229] The fourth aspect of the present invention provides an electronic device. In some embodiments of the present invention, Figure 7 As shown, an electronic device 700 is provided, comprising: the air quality data determination device 600 of any of the above embodiments; and / or the readable storage medium in the above embodiments. Therefore, the above electronic device 700 has all the beneficial effects of the air quality data determination device 600 of any of the above embodiments; and / or the above electronic device 700 has all the beneficial effects of the readable storage medium defined in the above embodiments, which will not be repeated here.
[0230] In the description of this specification, the description of the terms "one embodiment", "some embodiments", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0231] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for determining air quality data, characterized in that: include: Determining input feature data and output data of a target computing model, and constructing the target computing model according to the input feature data and the output data; Configuring a hyperparameter set of the target computing model, the hyperparameter set comprising a plurality of hyperparameter groups, at least one hyperparameter having a different value between different hyperparameter groups, and determining that at least two of the hyperparameter groups in the hyperparameter set constitute an initial hyperparameter set; Determine first target air quality data according to the initial hyperparameter set and the target calculation model, determine a first target sample according to the first target air quality data and actual air quality data, construct a target sample set, determine a first target hyperparameter group according to the Bayesian algorithm and the target sample set, construct a target hyperparameter set, and store the first target hyperparameter group and the at least two hyperparameter groups in the initial hyperparameter set into the target hyperparameter set; Determine a second target air quality data according to the first target hyperparameter group and the target calculation model, determine a second target sample according to the second target air quality data and the actual air quality data and update the target sample set, determine a second target hyperparameter group according to the Bayesian algorithm and the updated target sample set, and update the target hyperparameter set to complete one iteration; The target hyperparameter set is iterated and updated again until the number of iterations reaches a preset threshold, a target hyperparameter group in the target hyperparameter set is configured as a model hyperparameter group of the target calculation model, and the air quality data within a first preset time period is determined according to the configured target calculation model.
2. The air quality data determination method according to claim 1, characterized in that: The input feature data includes: WRF meteorological data and a calm weather index within the first preset time period, historical air quality data within the second preset time period, and site information data, wherein the calm weather index is determined by the WRF meteorological data; The output data includes: air quality data within the first preset time period.
3. The air quality data determination method according to claim 1, characterized in that: The determining the first target sample according to the first target air quality data and the actual air quality data specifically includes: Constructing an evaluation function, and determining evaluation parameter values of the first target air quality data and actual air quality data according to the evaluation function; The evaluation parameter value is negated, and the negated evaluation parameter value is determined as the first target sample.
4. The air quality data determination method according to claim 1, characterized in that: Determining the first target hyperparameter group according to the Bayesian algorithm and the target sample set specifically includes: According to the target sample set and the Gaussian process, the expected mean and variance of the target samples of all the hyperparameter groups in the hyperparameter set are fitted and calculated, and the hyperparameter groups and the expected mean and variance are in a one-to-one correspondence; Constructing an acquisition function based on the expected mean and variance, and determining that the hyperparameter group corresponding to the expected mean and variance corresponding to the current function value is the first target hyperparameter group based on the maximum function value of the acquisition function; The acquisition function is specifically defined as follows: the function value is equal to the expected mean plus 3 times the variance.
5. The air quality data determination method according to claim 4, characterized in that: Also includes: Storing the expected means corresponding to the at least two hyperparameter groups in the initial hyperparameter set into the target hyperparameter set; as well as Based on the maximum function value of the acquisition function, the expected mean value corresponding to the current function value is stored in the target hyperparameter set.
6. The air quality data determination method according to claim 5, characterized in that: The configuring a target hyperparameter group in the target hyperparameter set as a model hyperparameter group of the target computing model specifically includes: Comparing the sizes of the expected means in the target hyperparameter set; Based on the maximum expected mean, the target hyperparameter group corresponding to the expected mean is determined as the model hyperparameter group of the target computing model.
7. The air quality data determination method according to claim 1, characterized in that: Before determining the input characteristic data of the target calculation model, the air quality data determination method further includes: Acquiring the input feature data; Processing the input feature data using a random forest algorithm and a linear interpolation method to delete interference data in the input feature data and supplement missing data in the input feature data; The amplitude of the input feature data is configured according to prior knowledge.
8. An air quality data determination device, characterized in that: include: A construction unit, used to determine input feature data and output data of a target computing model, and to construct the target computing model according to the input feature data and the output data; A processing unit, configured to configure a hyperparameter set of the target computing model, the hyperparameter set comprising a plurality of hyperparameter groups, at least one hyperparameter having a different value between different hyperparameter groups, and determining that at least two of the hyperparameter groups in the hyperparameter set constitute an initial hyperparameter set; The processing unit is further used to determine the first target air quality data according to the initial hyperparameter set and the target calculation model, determine the first target sample according to the first target air quality data and the actual air quality data, construct a target sample set, determine the first target hyperparameter group according to the Bayesian algorithm and the target sample set, construct a target hyperparameter set, and store the first target hyperparameter group and the at least two hyperparameter groups in the initial hyperparameter set into the target hyperparameter set; The processing unit is further used to determine a second target air quality data according to the first target hyperparameter group and the target calculation model, determine a second target sample according to the second target air quality data and the actual air quality data and update the target sample set, determine a second target hyperparameter group according to the Bayesian algorithm and the updated target sample set, and update the target hyperparameter set to complete one iteration; The processing unit is further used to iteratively update the target hyperparameter set again until the number of iterations reaches a preset threshold, configure a target hyperparameter group in the target hyperparameter set as a model hyperparameter group of the target calculation model, and determine the air quality data within a first preset time period according to the configured target calculation model.
9. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the air quality data determination method according to any one of claims 1 to 7 are implemented.
10. An electronic device, characterized in that: include: The air quality data determination device as claimed in claim 8; and / or The readable storage medium as claimed in claim 9.
Citation Information
Patent Citations
Fine particle prediction and traceability method based on the combination of Gaussian process regression and firefly algorithm
CN109325616A
Prediction method and device for air quality, computer device and readable storage medium
CN110333556A
LightGBM fault diagnosis method based on improved Bayesian optimization
CN110413494A
Large-scale automated hyperparameter tuning
US20200226496A1
