Prophet-based medium-term electric quantity prediction method

By introducing custom seasonal and joint features into the Prophet model, combined with the collaborative prediction of AdaBoost and N-BEATSx algorithms, the problem of fusion of complex time series and multi-source exogenous variables is solved, and the accuracy of medium-term power prediction is significantly improved.

CN119965870AActive Publication Date: 2025-05-09CHANGCHUN UNIV OF TECH

Patent Information

Application Number
CN202510452592.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-11
Publication Date
2025-05-09
Estimated Expiration
2045-04-11

AI Technical Summary

Technical Problem

The prior art is difficult to fully explore the deep features of complex time series, and the fusion ability of multi-source exogenous variables is insufficient, resulting in poor medium-term power prediction results.

Method used

The mid-term power prediction method based on Prophet is adopted, and the coordinated prediction of custom seasonal, joint feature structure and AdaBoost algorithm and N-BEATSx are coordinated, combined with Optuna to adjust the hyperparameters, and the prediction accuracy is improved through Bayesian ridge regression stacking fusion.

Benefits of technology

Effectively capture the multi-scale characteristics of power data, optimize model performance, provide scientific basis for the medium-term scheduling and resource allocation of power systems, and significantly improve the accuracy of prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119965870A_ABST
    Figure CN119965870A_ABST
Patent Text Reader

Abstract

The invention relates to a Prophet-based medium-term electric quantity prediction method, and belongs to the field of medium-term electric quantity prediction of an electric power system. In order to solve the problem that a single Prophet model is difficult to fully mine complex time sequence deep features and fuse multi-source exogenous variables, the method comprises the following steps of: extracting time features by customizing seasons, performing trend, seasonal and holiday effect decomposition on historical targets, and constructing joint features to introduce exogenous variables; and meanwhile, an AdaBoost algorithm and an N-BEATSx model are adopted to realize monthly electric quantity prediction, and then optuna automatic parameter adjustment and Bayesian ridge regression are utilized to perform stacking fusion of prediction results. The method is suitable for medium-term scheduling planning of the power system and provides a scientific decision basis for power grid safety.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medium-term electricity consumption forecasting for power systems, and in particular to a medium-term electricity consumption forecasting method based on Prophet. Background Art

[0002] In recent years, the Prophet model has attracted attention for its ability to decompose trend, seasonality and holiday effects. However, a single Prophet model is difficult to fully explore the deep characteristics of complex time series and lacks the ability to integrate multi-source exogenous variables.

[0003] In this context, hybrid models that combine machine learning and deep learning have become a research hotspot. The Adaptive Boosting (AdaBoost) algorithm can effectively improve the robustness of predictions by integrating multiple weak learners, while the Neural Basis Expansion Analysis for TimeSeries with Exogenous Variables (N-BEATSx) algorithm uses deep neural networks to model the long-term dependencies of time series and supports the introduction of exogenous variables. In addition, the role of feature engineering in the processing of exogenous variables is becoming increasingly prominent, and the adaptability of the model to multidimensional data can be further enhanced by constructing joint features.

[0004] In existing research, hyperparameter tuning and model fusion strategies are crucial to improving prediction results. Therefore, a medium-term electricity forecasting method based on Prophet is proposed. Through customized seasonality, joint feature construction, and collaborative forecasting of the AdaBoost algorithm and N-BEATSx, it can not only effectively capture the multi-scale characteristics of electricity data, but also optimize model performance through data set verification and evaluation indicators, providing a scientific basis for the medium-term dispatch and resource allocation of the power system. Summary of the invention

[0005] A medium-term electricity forecasting method based on Prophet, the method comprising the following operations:

[0006] First, we use a certain province’s daily electricity consumption dataset to extract basic time features and customize seasonality.

[0007] Secondly, the Prophet model is used to decompose historical targets, implement feature engineering, construct joint features, and introduce exogenous variables.

[0008] Again, exogenous variables are used to perform monthly electricity forecasting using AdaBoost and N-BEATSx respectively.

[0009] Then, Optuna is used to adjust the hyperparameters of the Prophet model and the AdaBoost algorithm, the prediction results are updated, and then stacked and fused using Bayesian Ridge regression.

[0010] Finally, the entire Prophet-based medium-term electricity forecasting model is constructed, and then the model is verified using a provincial data set. The effectiveness of the model is judged by evaluation indicators. The specific process is as follows.

[0011] The present invention is a medium-term electricity forecasting method based on Prophet, which uses a daily electricity data set of a province to extract basic time features. , the function obtains multiple time features of the day and lists the year features Characteristics of the Moon : There are also weekly characteristics , daily characteristics , similar day characteristics of the year , based on monthly characteristics, customize seasonality, define four seasonal variables with seasonal indicator functions, and list spring variables and summer variables : By analogy, we can get the autumn variable , winter variables , from now on, to represent any one of them, it is generally referred to as .

[0012] The present invention uses the Prophet model to decompose historical targets, implement feature engineering, construct joint features, and introduce exogenous variables. The process specifically includes:

[0013] Step (1) For historical time , let the historical target be , represents the daily electricity consumption at the corresponding time, and uses the Prophet model to convert the historical target Decomposition into trend components , seasonal component and holiday portions and noise component Four parts form an additive model: For the trend component have: in, is the initial growth rate, is the initial intercept, is the number of preset change points, For the A time of change, For the The slope change at each change point can ensure that the contribution is 0 before the change point. For each custom season, Fourier expansion is used to represent a seasonal component. for: In the formula, is the Fourier order of the season, For the cycle, is the corresponding Fourier coefficient, and the total seasonal component is : Setting holiday indication function and holiday portions : in, Indicates holidays and their impact range, That is the A holiday indicator function, is the number of holiday types, For the The impact coefficient of holidays, and in the future , Prophet can fit , and , add the above three components to get Prophet in the future time The predicted value of : .

[0014] Step (2) Use Prophet's prediction results and original time information to construct a joint feature matrix. , construct the joint eigenvector: in That is, Prophet predicted value , Trend Component , Seasonal Component , Holiday Quantity ,here There is only future time, and the rest of the components have both historical and future time. In order to take the above time characteristics as exogenous variables, As a general term, .

[0015] The present invention uses exogenous variables and uses AdaBoost and N-BEATSx to perform monthly electricity forecasting. The process specifically includes:

[0016] Step (1) Use the AdaBoost algorithm to take advantage of the joint features Train multiple weak learners and obtain predictions through weighted average; based on the divided training set Samples, the initial weights are , for the weak learners, fit weak learners , then for The weak learner of training set samples is , with the normalization factor Represents the maximum error, and then uses the weak learner Define normalized error And calculate the weighted error and : in, For the The true value of the training set samples, For the The weak learner is The weights of the training set samples are used to calculate the weights of the weak learners. ,make , called the normalized error and, update the sample weights: in, No. The normalization constant of the weak learner, It only represents the value in exponential form. The final prediction of the AdaBoost algorithm model is a weighted average: .

[0017] Step (2) Use the N-BEATSx model to model historical sequences and exogenous variables through deep neural networks to achieve multi-step prediction. , for historical goals Use mean and standard deviation to get the normalized historical target , similarly, for the joint features Each exogenous variable Standardization obtains normalized exogenous variables , , assuming the history window length is To construct the input, corresponding to the normalized historical target sequence and the historical exogenous variable matrix : set up is the prediction step length, let The function represents the N-BEATSx model, and its parameters are , then the mapping prediction value is: in, is a known future exogenous variable, which corresponds to , , you can get the denormalized predicted value , using future time Indicates .

[0018] The present invention uses Optuna to automatically tune the parameters of the Prophet and AdaBoost algorithms, and adjusts the hyperparameters of the Prophet and AdaBoost algorithms at the same time, optimizes the prediction results of the AdaBoost algorithm and N-BEATSx, and sets the hyperparameter vector as: in, is the Fourier order of Prophet in each season, is the Prophet prior scale for trend change points, is the number of weak learners in the AdaBoost algorithm, is the maximum depth of the weak learner, is the learning rate of the AdaBoost algorithm, and the objective function is defined as the mean absolute percentage error of the validation set: in, is the true value on the validation set, is to use the hyperparameter vector The prediction values ​​of the trained model on the validation set include the prediction results of the AdaBoost algorithm and N-BEATSx. is the total number of samples in the validation set, and the optimal target parameter is: Optuna searches in the hyperparameter space and finally obtains the optimal target parameters Then, use it to retrain the Prophet and AdaBoost algorithm models.

[0019] The present invention uses the predicted value of the AdaBoost algorithm and the predicted values ​​of N-BEATSx , construct stacked features, set the meta-model to linear regression, and assume that the final model is: in, is the intercept, are the weights to be learned, obtained according to the Gaussian prior with L2 regularization, For noise that obeys Gaussian distribution, the target form is: in, Indicates the test set stage for future predictions, is the regularization parameter, so the optimal , the final stacked fusion prediction is: , and then get the prediction results of each time step, which is the complete prediction result.

[0020] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: (1) The present invention extracts a variety of time features, which is beneficial for the model to deeply explore the time relationship; (2) The present invention forms a joint feature based on the time features obtained by Prophet decomposition and the original time features, and assists the AdaBoost model and the N-BEATSx model to complete the prediction; (3) The present invention uses the Optuna module to tune the parameters of Prophet and AdaBoost to obtain the optimal state of the model; (4) The present invention designs the prediction results of the Bayesian Ridge regression stacking fusion AdaBoost model and N-BEATSx model, which improves the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a specific flow chart of a medium-term electricity forecasting method based on Prophet of the present invention;

[0022] Figure 2 is a structural diagram of a sliding window in an example of the present invention;

[0023] Figure 3 It is a comparison chart of the test set prediction results of the example of the present invention. DETAILED DESCRIPTION

[0024] The present invention is further described below in conjunction with the accompanying drawings. The embodiments are to more clearly illustrate the technical solution of the present invention, and the application scope of the present invention is not limited thereto and can be applied to many fields. Here is just one example.

[0025] like Figure 1 As shown, the present invention provides a medium-term electricity forecasting method based on Prophet, which is specifically divided into the following steps:

[0026] First, we use a certain province’s daily electricity dataset to extract basic time features. , the function obtains multiple time features of the day and lists the year features Characteristics of the Moon : There are also weekly characteristics , daily characteristics , similar day characteristics of the year , based on monthly characteristics, customize seasonality, define four seasonal variables with seasonal indicator functions, and list spring variables and summer variables : By analogy, we can get the autumn variable , winter variables , from now on, to represent any one of them, it is generally referred to as .

[0027] Secondly, the Prophet model is used to decompose historical targets, implement feature engineering, construct joint features, and introduce exogenous variables. The process specifically includes:

[0028] Step (1) Historical time , let the historical target be , represents the daily electricity consumption at the corresponding time, and uses the Prophet model to convert the historical target Decomposition into trend components , seasonal component and holiday portions and noise component Four parts form an additive model: For the trend component have: in, is the initial growth rate, is the initial intercept, is the number of preset change points, For the A time of change, For the The slope change at each change point can ensure that the contribution is 0 before the change point. For each custom season, Fourier expansion is used to represent a seasonal component. for: In the formula, is the Fourier order of the season, For the cycle, is the corresponding Fourier coefficient, the total seasonal component for: Setting holiday indication function and holiday portions : in, Indicates holidays and their impact range, That is the A holiday indicator function, is the number of holiday types, For the The impact coefficient of holidays, and in the future , Prophet can fit , and , add the above three components to get Prophet in the future time The predicted value of : .

[0029] Step (2) Use Prophet's prediction results and original time information to construct a joint feature matrix. , construct the joint eigenvector: in That is, Prophet predicted value , Trend Component , Seasonal Component , Holiday Quantity ,here There is only future time, and the rest of the components have both historical and future time. In order to take the above time characteristics as exogenous variables, As a general term, .

[0030] Thirdly, using exogenous variables, the AdaBoost algorithm and N-BEATSx are used to predict monthly electricity consumption. The specific process includes:

[0031] Step (1) Use the AdaBoost algorithm to take advantage of the joint features Train multiple decision trees and obtain predictions through weighted average; based on the divided training set Samples, the initial weights are , for the decision trees, fit decision trees , then for The decision tree for the training set samples is , with the normalization factor Represents the maximum error, and then uses the decision tree Define normalized error and calculate the weighted error and : in, For the The true value of the training set samples, For the The decision tree for The weights of the training set samples are used to calculate the decision tree weights. ,make , called the normalized error and, update the sample weights: in, No. The normalization constant for a decision tree, It only represents the value in exponential form. The final prediction of the AdaBoost algorithm model is a weighted average: .

[0032] Step (2) Use the N-BEATSx model to model historical sequences and exogenous variables through deep neural networks to achieve multi-step prediction. , for the historical target value Use mean and standard deviation to get the normalized historical target , similarly, for the joint features Each exogenous variable Standardization obtains normalized exogenous variables , ,like Figure 2 As shown, let the history window length be , is the step size of the sliding window sliding to the right, is the prediction step length, corresponding to the normalized historical target sequence and the historical exogenous variable matrix : If you The function represents the N-BEATSx model, and its parameters are , then the mapping prediction value is: in, is a known future exogenous variable, which corresponds to , , you can get the denormalized predicted value , using future time Indicates .

[0033] Then, Optuna is used to automatically tune the parameters of the Prophet and AdaBoost algorithms, and the hyperparameters of the Prophet and AdaBoost algorithms are adjusted to optimize the prediction results of the AdaBoost algorithm and N-BEATSx. The hyperparameter vector is: in, is the Fourier order of Prophet in each season, is the Prophet prior scale for trend change points, is the number of decision trees in the AdaBoost algorithm, is the maximum depth of the decision tree, is the learning rate of the AdaBoost algorithm, and the objective function is defined as the mean absolute percentage error of the validation set: in, is the true value on the validation set, is to use the hyperparameter vector The prediction values ​​of the trained model on the validation set include the prediction results of the AdaBoost algorithm and N-BEATSx. is the total number of samples in the validation set, and sets the optimal target parameter: Optuna searches in the hyperparameter space and finally obtains the optimal target parameters Then, use it to retrain the Prophet and AdaBoost algorithm models.

[0034] The present invention uses the predicted value of the AdaBoost algorithm and the predicted values ​​of N-BEATSx , construct stacked features, set the meta-model to linear regression, and assume that the final model is: in, is the intercept, are the weights to be learned, obtained according to the Gaussian prior with L2 regularization, For noise that obeys Gaussian distribution, the target form is: in, Indicates the test set stage for future predictions, is the regularization parameter, so the optimal , the final stacked fusion prediction is: , and then get the prediction results of each time step, which is the complete prediction result.

[0035] Finally, the entire Prophet-based medium-term electricity forecasting model is constructed, and then the model is verified using a provincial data set. The effectiveness of the model is judged by evaluation indicators. In the example of the present invention, the mean absolute percentage error (MAPE [%]) and the mean absolute proportional error (MASE [%]) are selected for verification. The formulas of the two are: In the formula, Is the test set The predicted power value at the moment, Is the test set The actual value of power at the moment, is the predicted future time step for the test set.

[0036] The prediction results are shown in Table 1. When other model conditions are the same, the proposed model is compared with Prophet-AdaBoost, Prophet-N-BEATSx and simple average fusion models to predict the average power consumption in the next month, and the evaluation index is used to judge the effectiveness of the model. The prediction curve of the test set is shown in Table 1. Figure 3As shown, for clarity of illustration, only the results of Prophet-AdaBoost, Prophet-N-BEATSx and this model are plotted.

[0037] Table 1 Model evaluation index results table: Model MAPE [%] MASE [%] Prophet-AdaBoost 0.051 1.115 Prophet-N-BEATSx 0.048 1.077 Simple average fusion 0.048 1.069 Prediction model of the present invention 0.040 0.847 From the results in Table 1, it can be seen that the effect achieved by the prediction model of the present invention is optimal, which can prove the benefits of the present invention.

Claims

1. A medium-term electricity forecasting method based on Prophet, characterized in that: The method includes the following operations: first, using a daily electricity data set of a certain province, extracting basic time features and customizing seasonality; second, completing the decomposition of historical targets through the Prophet model, implementing feature engineering, constructing joint features, and introducing exogenous variables; third, using exogenous variables, using the adaptive boosting algorithm and the Neural BasisExpansion Analysis for Time Series with Exogenous Variables (N-BEATSx) algorithm to perform monthly electricity forecasting; then, using Optuna to adjust the hyperparameters of the Prophet model and the adaptive boosting algorithm, updating the forecast results, and stacking and fusion using Bayesian Ridge regression; finally, constructing the entire medium-term electricity forecasting model based on Prophet, and then using a provincial data set to verify the model, and judging the effectiveness of the model through evaluation indicators.

2. A medium-term electricity forecasting method based on Prophet as claimed in claim 1, characterized in that: The daily electricity consumption data set of a province can be used to extract basic time features. , various time features are obtained by the function, and the year features are listed Characteristics of the Moon : There are also weekly characteristics , daily characteristics , similar day characteristics of the year , based on monthly characteristics, customize seasonality, define four seasonal variables with seasonal indicator functions, and list spring variables and summer variables : By analogy, we can get the autumn variable , winter variables , from now on, to represent any one of them, it is generally referred to as ; The Prophet model decomposes historical targets, implements feature engineering, constructs joint features, and introduces Exogenous variables, the process specifically includes: Step (1) Historical time , let the historical target be , represents the daily electricity consumption at the corresponding time, and uses the Prophet model to convert the historical target Decomposition into trend components , seasonal component and holiday portions and noise component Four parts form an additive model: For the trend component have: in, is the initial growth rate, is the initial intercept, is the number of preset change points, For the A time of change, For the The slope change at each change point can ensure that the contribution is 0 before the change point. For each custom season, Fourier expansion is used to represent a seasonal component. and the total seasonal component The relationship is: In the formula, is the Fourier order of the season, For the cycle, Set the holiday indicator function as the corresponding Fourier coefficient and holiday portions : in, Indicates holidays and their impact range, That is the A holiday indicator function, is the number of holiday types, For the The impact coefficient of holidays, and in the future , Prophet can fit , and , add the above three components to get the predicted value of Prophet : ; Step (2) Use Prophet's prediction results and original time information to construct a joint feature matrix. , construct the joint eigenvector: in That is, Prophet predicted value , Trend Component , Seasonal Component , Holiday Quantity ,here There is only future time, and the rest of the components have both historical and future time. In order to take the above time characteristics as exogenous variables, As a general term, .

3. A medium-term electricity forecasting method based on Prophet as claimed in claim 1, characterized in that: The adaptive lifting model and N-BEATSx will perform predictions respectively, and the process specifically includes: Step (1) Using joint features Train multiple weak learners and obtain predictions through weighted average; based on the divided training set Samples, the initial weights are , for the weak learners, fit weak learners , then for The weak learner of training set samples is , with the normalization factor Represents the maximum error, and then uses the weak learner Define normalized error And calculate the weighted error and : in, For the The true value of the training set samples, For the The weak learner is The weights of the training set samples are used to calculate the weights of the weak learners. ,make , called the normalized error sum, is used to update the sample weights: in, No. The normalization constant of the weak learner, It only represents the value in exponential form, and the final prediction of the adaptive boosting algorithm model is a weighted average: ; Step (2) Use the N-BEATSx model to model historical sequences and exogenous variables through deep neural networks to achieve multi-step prediction. , for historical goals Use mean and standard deviation to get the normalized historical target , similarly, for the joint features Each exogenous variable Standardization obtains normalized exogenous variables , , assuming the history window length is To construct the input, corresponding to the normalized historical target sequence and the historical exogenous variable matrix : set up is the prediction step length, let The function represents the N-BEATSx model, and its parameters are , then the mapping prediction value is: in, is a known future exogenous variable, which corresponds to , , you can get the denormalized predicted value , using future time Indicates .

4. A medium-term electricity forecasting method based on Prophet as claimed in claim 1, characterized in that: The Optuna described above can adjust the hyperparameters of Prophet and the adaptive boosting algorithm at the same time, optimize the prediction results of the adaptive boosting algorithm and N-BEATSx, and let the hyperparameter vector be: in, is the Fourier order of Prophet in each season, is the Prophet trend change point prior scale, To adaptively increase the number of weak learners in the algorithm, is the maximum depth of the weak learner, To adaptively improve the learning rate of the algorithm, the objective function is defined as the mean absolute percentage error of the validation set: in, is the true value on the validation set, is to use the hyperparameter vector The prediction values ​​of the trained model on the validation set include the prediction results of adaptive boosting and N-BEATSx. is the total number of samples in the validation set, and the optimal target parameter is: Optuna searches in the hyperparameter space and finally obtains the optimal target parameters Then, use it to retrain the Prophet and adaptive boosting algorithm models.

5. A medium-term electricity forecasting method based on Prophet as claimed in claim 1, characterized in that: The Bayesian Ridge regression uses the adaptive boosting algorithm to predict the value of and the predicted values ​​of N-BEATSx , construct stacked features, set the meta-model to linear regression, and assume that the final model is: in, is the intercept, are the weights to be learned, obtained according to the Gaussian prior with L2 regularization, For noise that obeys Gaussian distribution, the target form is: in, Indicates the test set stage for future predictions, is the regularization parameter, and the optimal , the final stacked fusion prediction is: , and then get the prediction results of each time step, which is the complete prediction result.

Citation Information

Patent Citations

  • Electric quantity prediction method and system based on prophet-Light GBM combination model

    CN115470970A

  • Energy consumption prediction method and device, equipment and storage medium

    CN115577851A

  • Monthly electric quantity decomposition and prediction method based on Prophet-X-12-ARIMA combination model

    CN117592598A

  • Load prediction method and device of power system and electronic equipment

    CN119482395A

Cited By

  • Electric quantity prediction method based on empirical Fourier decomposition and sample entropy aggregation

    CN121188719A

  • PM2.5 prediction method based on Prophet and residual time Kriging

    CN122413387A