A medium-term electricity forecasting method based on Prophet

By customizing seasonality, constructing joint features, combining AdaBoost and N-BEATSx models, and tuning hyperparameters with Optuna, the fusion problem of the Prophet model for complex time series and exogenous variables in mid-term power prediction is solved, and the prediction accuracy is improved.

CN119965870BActive Publication Date: 2025-08-29CHANGCHUN UNIV OF TECH

Patent Information

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

AI Technical Summary

Technical Problem

The existing Prophet model is difficult to fully explore the deep features of complex time series, and its fusion ability of multi-source exogenous variables is insufficient, which affects the accuracy of medium-term power prediction.

Method used

By customizing seasonality, constructing joint features, combining AdaBoost algorithm and N-BEATSx model, Optuna tuning hyperparameters are used to perform Bayesian ridge regression stacking fusion to improve the performance of the prediction model.

Benefits of technology

The accuracy of medium-term power prediction is improved, and the model's adaptability to multidimensional data is enhanced through the extraction of multiple time features and feature engineering, and the prediction effect is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119965870B_ABST
    Figure CN119965870B_ABST
Patent Text Reader

Abstract

This invention relates to a medium-term electricity forecasting method based on Prophet, and belongs to the field of medium-term electricity forecasting for power systems. To address the difficulty of a single Prophet model in fully exploring the deep features of complex time series and integrating multi-source exogenous variables, this method extracts time features through customized seasonality, decomposes historical targets into trend, seasonality, and holiday effects, and constructs joint features to introduce exogenous variables. Furthermore, the AdaBoost algorithm and the N-BEATSx model are used to achieve monthly electricity forecasts, respectively. Optuna automatic parameter adjustment and Bayesian Ridge regression are then used to stack and fuse the forecast results. This method is suitable for medium-term dispatch planning of power systems, providing a scientific decision-making basis for grid security.
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 cannot fully explore the deep characteristics of complex time series and lacks the ability to integrate multiple exogenous variables.

[0003] In this context, hybrid models combining machine learning and deep learning have become a research hotspot. The Adaptive Boosting (AdaBoost) algorithm effectively improves forecasting robustness by integrating multiple weak learners, while the Neural Basis Expansion Analysis for Time Series with Exogenous Variables (N-BEATSx) algorithm utilizes deep neural networks to model long-term dependencies in time series and supports the introduction of exogenous variables. Furthermore, feature engineering is playing an increasingly important role in handling exogenous variables. The construction of joint features can further enhance the model's adaptability to multidimensional data.

[0004] In existing research, hyperparameter tuning and model fusion strategies are crucial for improving forecasting results. Therefore, a medium-term electricity forecasting method based on Prophet is proposed. By customizing seasonality, constructing joint features, and integrating the AdaBoost algorithm with N-BEATSx for collaborative forecasting, this method not only effectively captures the multi-scale characteristics of electricity data but also optimizes model performance through dataset validation and evaluation metrics, providing a scientific basis for medium-term dispatch and resource allocation of power systems. 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 daily electricity consumption dataset from a certain province 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] Thirdly, exogenous variables are used to perform monthly electricity consumption 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, we constructed a medium-term electricity consumption forecasting model based on Prophet, and then used a provincial data set to verify the model. The effectiveness of the model was determined 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 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 and lunar characteristics :

[0012]

[0013] 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 :

[0014]

[0015] By analogy, we can get the autumn variable , winter variables , in the future, to represent any one of them, it is generally referred to as .

[0016] 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:

[0017] 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 components Four parts form an additive model:

[0018]

[0019] For the trend component have:

[0020]

[0021] 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, and for each custom season, Fourier expansion is used to represent a seasonal component. for:

[0022]

[0023] Where, is the Fourier order of the season, For the cycle, is the corresponding Fourier coefficient, and the total seasonal component is :

[0024]

[0025] Setting holiday indicator function and holiday portions :

[0026]

[0027]

[0028] 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] .

[0030] Step (2) Use Prophet's prediction results and original time information to construct a joint feature matrix. , construct the joint eigenvector:

[0031]

[0032] in That is, Prophet predicted value , Trend component , seasonal component , Holiday portion ,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, .

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

[0034] Step (1) Use the AdaBoost algorithm to utilize the joint features Train multiple weak learners and obtain predictions through weighted average; based on the divided training set Samples, initial weights are , for the weak learners, fitting weak learners , then for the The weak learner of the 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 :

[0035]

[0036]

[0037] in, For the The true value of the training set samples, For the A 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, updates the sample weights:

[0038]

[0039]

[0040] in, No. The normalization constant of the weak learner, It only expresses the value in exponential form. The final prediction of the AdaBoost algorithm model is a weighted average:

[0041] .

[0042] 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 Normalized historical targets using mean and standard deviation , 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 :

[0043]

[0044]

[0045] 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:

[0046]

[0047] in, is a known future exogenous variable, which corresponds to , , you can get the denormalized predicted value , using future time Indicates .

[0048] This paper 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 to optimize the prediction results of the AdaBoost algorithm and N-BEATSx. The hyperparameter vector is:

[0049]

[0050] in, is the Fourier order of Prophet's respective seasons, Prophet is the prior scale of trend change point, 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:

[0051]

[0052] in, is the true value on the validation set, is to use the hyperparameter vector The predicted 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:

[0053]

[0054] Optuna searches in the hyperparameter space and finally obtains the optimal target parameters Then, use it to retrain the Prophet and AdaBoost algorithm models.

[0055] The present invention uses the prediction value of AdaBoost algorithm and the predicted value of N-BEATSx , construct stacked features, set the meta-model to linear regression, and assume that the final model is:

[0056]

[0057] 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:

[0058]

[0059] in, Indicates the test set stage in future predictions, is the regularization parameter, so the optimal , and the final stacked fusion prediction is:

[0060] , and then get the prediction results of each time step, which is the complete prediction result.

[0061] Compared with the existing technology, the beneficial effects achieved by the present invention are as follows: (1) The present invention extracts multiple time features, which is conducive to 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 accuracy of the prediction. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

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

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

[0067] 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 and lunar characteristics :

[0068]

[0069] 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 :

[0070]

[0071] By analogy, we can get the autumn variable , winter variables , in the future, to represent any one of them, it is generally referred to as .

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

[0073] 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 components Four parts form an additive model:

[0074]

[0075] For the trend component have:

[0076]

[0077] 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, and for each custom season, Fourier expansion is used to represent a seasonal component. for:

[0078]

[0079] Where, is the Fourier order of the season, For the cycle, is the corresponding Fourier coefficient, the total seasonal component for:

[0080]

[0081] Setting holiday indicator function and holiday portions :

[0082]

[0083]

[0084] 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 :

[0085] .

[0086] Step (2) Use Prophet's prediction results and original time information to construct a joint feature matrix. , construct the joint eigenvector:

[0087]

[0088] in That is, Prophet predicted value , Trend component , seasonal component , Holiday portion ,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, .

[0089] Thirdly, using exogenous variables, we use the AdaBoost algorithm and N-BEATSx to perform monthly electricity consumption forecasting. The specific process includes:

[0090] Step (1) Use the AdaBoost algorithm to utilize the joint features Train multiple decision trees and obtain predictions through weighted average; based on the divided training set Samples, initial weights are , for the decision trees, fitting decision trees , then for the The decision tree for the training set samples is , with the normalization factor Indicates the maximum error, and then uses the decision tree Define normalized error and calculate the weighted error and :

[0091]

[0092]

[0093] in, For the The true value of the training set samples, For the A decision tree for The weight of the training set samples is used to calculate the decision tree weight. ,make , called the normalized error sum, updates the sample weights:

[0094]

[0095]

[0096] in, No. The normalization constant of the decision tree, It only represents the value in exponential form. The final prediction of the AdaBoost algorithm model is a weighted average:

[0097] .

[0098] Step (2) Use the N-BEATSx model to model historical sequences and exogenous variables through deep neural networks to achieve multi-step predictions. , for historical target values Normalized historical targets using mean and standard deviation , 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 :

[0099]

[0100]

[0101] If the order The function represents the N-BEATSx model, and its parameters are , then the mapping prediction value is:

[0102]

[0103] in, is a known future exogenous variable, which corresponds to , , you can get the denormalized predicted value , using future time Indicates .

[0104] Then, Optuna is used to automatically tune the parameters of the Prophet and AdaBoost algorithms. At the same time, 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:

[0105]

[0106] in, is the Fourier order of Prophet's respective seasons, Prophet is the prior scale of trend change point, 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:

[0107]

[0108] in, is the true value on the validation set, is to use the hyperparameter vector The predicted values ​​of the trained model on the validation set include the prediction results of the AdaBoost algorithm and N-BEATSx. For the total number of validation set samples, set the optimal target parameter:

[0109]

[0110] Optuna searches in the hyperparameter space and finally obtains the optimal target parameters Then, use it to retrain the Prophet and AdaBoost algorithm models.

[0111] The present invention uses the prediction value of AdaBoost algorithm and the predicted value of N-BEATSx , construct stacked features, set the meta-model to linear regression, and assume that the final model is:

[0112]

[0113] 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:

[0114]

[0115] in, Indicates the test set stage in future predictions, is the regularization parameter, so the optimal , and the final stacked fusion prediction is:

[0116] , and then get the prediction results of each time step, which is the complete prediction result.

[0117] 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 this example, the mean absolute percentage error (MAPE [%]) and the mean absolute proportional error (MASE [%]) are selected for verification. The formulas for the two are:

[0118]

[0119] Where, 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.

[0120] The prediction results are shown in Table 1. Under the same model conditions, the proposed model is compared with three models: Prophet-AdaBoost, Prophet-N-BEATSx and simple average fusion. The average power consumption in the next month is predicted, 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 3 As shown in the figure, for clarity of explanation, only the results of Prophet-AdaBoost, Prophet-N-BEATSx and this model are plotted.

[0121] Table 1 Model evaluation index results table:

[0122] 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

[0123] From the results in Table 1, it can be seen that the effect achieved by the prediction model of the present invention is the best, 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 to extract basic time features and customize seasonality; second, using the Prophet model to complete the decomposition of historical targets, implement feature engineering, construct joint features, and introduce exogenous variables; third, using the exogenous variables, using the adaptive boosting algorithm and the Neural Basis Expansion Analysis for Time Series with Exogenous Variables (N-BEATSx) algorithm to perform monthly electricity forecasting, respectively, to obtain two forecast results; then, using Optuna to adjust the hyperparameters of the Prophet model and the adaptive boosting algorithm, update the two forecast results, and use Bayesian Ridge regression to stack and fuse the two updated forecast results to obtain the final forecast result; finally, constructing the entire Prophet-based medium-term electricity forecasting model, and then using the provincial data set to verify the model, and judging the effectiveness of the model through evaluation indicators; the daily electricity data set of the certain province can be used to extract basic time features. For any time t, multiple time features are obtained by the function, and the annual feature X is listed. year (t) and monthly characteristic X mon (t): X year (t)=Year(t),X mon (t)=Month(t) There is also a weekly feature X week (t), daily characteristics X day (t), annual similar day characteristics X dofy (t), based on monthly characteristics, customize seasonality, define four seasonal variables with seasonal indicator functions, and list the spring variable X spring (t) and summer variable X summer (t): By analogy, we can get the autumn variable X autumn (t), winter variable X winter (t), from now on, to represent any one of them, it is generally referred to as X season (t); The Prophet model decomposes historical targets, implements feature engineering, constructs joint features, and introduces Exogenous variables, the process specifically includes: Step (1) For the historical time t, let the historical target be y(t), which represents the daily electricity consumption at the corresponding time. Use the Prophet model to decompose the historical target y(t) into four parts: trend component g(t), seasonal component s(t), holiday component h(t), and noise component ε(t), forming an additive model: y(t)=g(t)+s(t)+h(t)+ε(t) For the trend component g(t), we have: Among them, k is the initial growth rate, m is the initial intercept, V is the number of preset change points, s v is the time of the vth change point, δ v is the slope change at the vth change point, which can ensure that the contribution is 0 before the change point. For each custom season, Fourier expansion is used to represent a seasonal component N. season (t) and the total seasonal component s(t) are related as follows: Where N season is the Fourier order of the season, P is the period, For the corresponding Fourier coefficient, set the holiday indicator function D(t) and holiday component h(t): Among them, holiday refers to holidays and their impact range, D g (t) is the g-th holiday indicator function, G is the number of holiday types, k g is the impact coefficient of the g-th holiday, and at the future time t, Prophet can fit g(t), s(t) and h(t). The above three components are added together to obtain the Prophet prediction value Step (2) uses Prophet's prediction results and original time information to construct a joint feature matrix. For a certain time t, a joint feature vector is constructed: X(t)=[X yhat (t),X trend (t),X seas (t),X hol (t),X year (t),X mon (t),X week (t),X day (t),X dofy (t)] where X yhat (t) is the Prophet prediction value X trend (t) is the trend component g(t), X seas (t) is the seasonal component s(t), X hol (t) is the holiday component h(t), where X yhat (t) only has future time, and the rest of the components have both historical and future time. In order to make it convenient to take the above time characteristics as exogenous variables, we will use x (j) (t) is a general term, j = 1, ..., J.

2. The medium-term electricity forecasting method based on Prophet according to claim 1, characterized in that: The prediction process of the adaptive boosting algorithm and N-BEATSx respectively includes: Step (1) uses the joint feature X(t) to train multiple weak learners and obtain predictions through weighted average; according to the divided training set n=1,...,N samples, the initial weights are For the m=1,...,Mth weak learners, fit the weak learner h m (X(t)), then the weak learner for the nth training set sample is h m (X n ), the normalization factor Z is used to represent the maximum error, and then the weak learner h m (X n ) Define the normalized error e n,m and calculate the weighted error and ε m : Among them, y n is the true value of the nth training set sample, Calculate the weight of the weak learner α as the weight of the mth weak learner for the nth training set sample m ,make It is called the normalized error sum, which is used to update the sample weights: Among them, C m The normalization constant of the mth weak learner, It only expresses 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 the historical sequence and exogenous variables through a deep neural network to achieve multi-step prediction. For the historical time t, the historical target y(t) is normalized using the mean and standard deviation to obtain the normalized historical target Similarly, for each exogenous variable x of the joint feature X(t) (j) (t) Standardization to obtain normalized exogenous variables j=1,...,J,assuming the history window length is L to construct the input, corresponding to the normalized history target sequence and the historical exogenous variable matrix Let h be the prediction step size, let the F function represent the N-BEATSx model, and the parameter is Θ, then the mapping prediction value is: in, is a known future exogenous variable, which corresponds to τ=1,…,h,then we can get the denormalized prediction value The future time t is expressed as 3. The mid-term electricity forecasting method based on Prophet according to claim 1, characterized in that: The aforementioned Optuna can adjust the hyperparameters of Prophet and the adaptive boosting algorithm simultaneously, optimizing the prediction results of the adaptive boosting algorithm and N-BEATSx. Let the hyperparameter vector be: θ=(N season ,cps,n estim ,d,η) Among them, N season is the Fourier order of Prophet in each season, cps is the prior scale of Prophet trend change point, n estim is the number of weak learners in the adaptive boosting algorithm, d is the maximum depth of the weak learners, η is the learning rate of the adaptive boosting algorithm, and the objective function is defined as the mean absolute percentage error of the validation set: Among them, y i is the true value on the validation set, is the predicted value of the model trained with the hyperparameter vector θ on the validation set, which contains the prediction results of adaptive improvement and N-BEATSx, respectively. val 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 parameter θ * Then, use it to retrain the Prophet and adaptive boosting algorithm models.

4. The mid-term electricity forecasting method based on Prophet according to claim 1, characterized in that: The Bayesian Ridge regression uses the adaptive boosting algorithm to predict the value of and the predicted value of N-BEATSx Construct stacked features, set the meta-model to linear regression, and assume that the final model is: Where β0 is the intercept, β1 and β2 are the weights to be learned, which are obtained based on the Gaussian prior with L2 regularization, ε′(t) is the noise that follows the Gaussian distribution, and the target form is: Among them, t∈test represents the test set stage in the future prediction, λ is the regularization parameter, and the optimal The final stacked fusion prediction is: Then the prediction results of each time step are obtained, 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

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

    CN119482395A

Cited By

  • Daily electricity consumption prediction method and system based on modular bypass and gating fusion

    CN121615819A