Short-term power load prediction method and system combining linear regression and genetic programming symbol regression
By combining a hybrid model of linear regression and genetic programming symbolic regression, the problems of interpretability and robustness in short-term power load forecasting are solved, high-precision prediction and dynamic adaptability of power load are achieved, and the adaptability and interpretability of the model are improved.
Patent Information
- Application Number
- CN202510776911.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-19
AI Technical Summary
Existing short-term power load forecasting methods lack interpretability and robustness in dealing with complex and changeable real-world scenarios, and it is difficult to dynamically adjust the forecast results, especially when there are extreme weather changes, equipment failures, or abnormal holiday loads.
Combining linear regression with genetic programming symbolic regression, linear regression is used to capture the linear trend of power load, and genetic programming is used to fit the residuals to construct a hybrid model to improve the prediction accuracy and model interpretability, and enhance the adaptability to complex load changes.
It achieves high-precision prediction of power load, improves the adaptability and adaptability of the model, especially performs well in complex load scenarios, and provides good interpretability and dynamic adjustment capabilities.
Smart Images

Figure CN120671097A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of short-term power load forecasting methods, and in particular to a short-term power load forecasting method and system combining linear regression with genetic programming symbolic regression. Background Art
[0002] Power load forecasting is a crucial technology for maintaining a balance between electricity supply and demand. It provides critical data for power system planning, construction, and operation, and is a prerequisite for the development of smart grids. Based on the forecast timeframe, power load forecasting can be categorized as short-term (minutes or hours) or long-term (years). Short-term power load forecasting is particularly important, helping grid operators reduce operating costs and prevent failures. However, due to factors such as weather and holidays, as well as the complexities associated with the rapid adoption of renewable energy, short-term power load forecasting remains a significant challenge.
[0003] Existing short-term power load forecasting methods primarily include statistical, machine learning, and deep learning methods. Statistical methods, such as autoregressive models, are simple and interpretable, but struggle to capture nonlinear relationships. Machine learning methods, such as support vector regression and neural networks, can model nonlinear relationships, but their adaptability to complex, high-dimensional data is limited. Deep learning methods, such as long-short-term memory networks and convolutional neural networks, have demonstrated promising predictive capabilities in recent years. However, these models are complex, lack interpretability, and rely heavily on training data.
[0004] In contrast, genetic programming has shown significant advantages in tasks such as symbolic regression and time series forecasting due to its flexible model representation, lack of predefined structure, and high interpretability. Genetic programming searches for the optimal function model through evolutionary computation, which can capture the complex nonlinear relationship between independent and dependent variables. The generated model is represented by a tree structure and has good transparency. However, research on genetic programming in short-term power load forecasting is still limited. Most of the research is based on highly controlled experimental environments, making it difficult to verify its generalization ability across different load characteristics and data sizes. In addition, the significant differences in the numerical range and fluctuation pattern of power load data may affect the convergence speed and forecasting performance of genetic programming.
[0005] To address these issues, the inventors discovered that by combining linear regression to capture the underlying load variation patterns, genetic programming to further fit the nonlinear relationships in the residuals, and constructing a suitable set of functions, they were able to achieve high-precision predictions of complex load variations. Experimental results demonstrate that this approach outperforms traditional methods in adaptability, interpretability, and predictive performance, particularly in complex load scenarios.
[0006] However, the above solution still has the following technical problems:
[0007] While existing models have achieved some success in the field of short-term power load forecasting, different techniques have their own advantages. For example, statistical methods, with their simplicity and interpretability, excel in capturing linear relationships and offer high stability and reliability. Machine learning methods (such as support vector regression and multilayer perceptrons) and deep learning methods (such as long short-term memory networks and convolutional neural networks) demonstrate strong nonlinear modeling capabilities. These methods can effectively handle nonlinear characteristics in load data and, in certain scenarios, provide high forecasting accuracy, providing strong support for power system planning and operation. However, these methods also have significant shortcomings that hinder their effectiveness in practical applications. First, existing models generally lack good interpretability, especially deep learning methods, whose internal decision-making processes are often "black boxes," making it difficult to understand how the models arrive at their forecasts. This limitation not only complicates model debugging and optimization but also restricts their application in power systems where transparency and interpretability are crucial.
[0008] Furthermore, these models lack adaptability when responding to unexpected situations such as extreme weather events, equipment failures, or holiday load anomalies. This makes it difficult to dynamically adjust forecast results, potentially leading to a significant increase in the discrepancy between actual and predicted power load data. Therefore, improving the interpretability and robustness of these models, particularly in order to accurately forecast load in complex and changing real-world scenarios, remains a pressing challenge in the field. Summary of the Invention
[0009] This invention aims to overcome the shortcomings of the existing technology by developing a short-term power load forecasting method based on a combination of linear regression and genetic programming symbolic regression. By leveraging the efficiency of linear regression models and the adaptability and interpretability of genetic programming, this method achieves accurate power load forecasting, improves the model's ability to capture complex nonlinear relationships, and enhances its robustness to emergencies.
[0010] The technical solution adopted by the present invention is: a short-term power load forecasting method and system based on linear regression and genetic programming symbolic regression, comprising the following steps:
[0011] S1, obtain historical power load data;
[0012] S2, using a sliding window to preprocess the acquired historical power load data and divide it into input feature variables and target values;
[0013] S3, dividing the preprocessed power load data into a training set and a test set;
[0014] S4, use linear regression to model the training set data and obtain the initial prediction value of the training set;
[0015] S5, apply the constructed linear regression model to the test set data to obtain the initial prediction value of the test set;
[0016] S6, calculate the residuals of the linear regression model;
[0017] S7, initialize a population using the search space constructed by inputting feature variables, function sets and random numbers from the training set;
[0018] S8, evaluates the fitness of individuals in the population through root mean square error;
[0019] S9, uses crossover and mutation operations to generate offspring;
[0020] S10, directly copy the best offspring individuals to the next generation;
[0021] S11, evaluates the fitness of individuals in the population through root mean square error;
[0022] S12, judging whether the conditions for terminating the iteration are met; if the conditions are not met, turning to S9; if the conditions are met, turning to S13;
[0023] S13, the best individual obtained from the training set is tested on the test set for the short-term power load forecasting scenario;
[0024] S14, adding the initial prediction value of the linear regression model and the prediction value of the residual of the genetic programming model to obtain the final power load prediction result.
[0025] Furthermore, the specific steps of S2 are:
[0026] S21, set the length W of the sliding window, that is, the number of consecutive data points contained in each window;
[0027] S22, using a sliding window to sequentially extract W consecutive data points from the historical power load data as input feature variables;
[0028] S23, for each sliding window, the first data point immediately after the sliding window is taken as the target value, i.e., the predicted value;
[0029] S24, by sliding the window on the time series with a fixed step size of 1, extracting the feature variables and target values one by one.
[0030] Furthermore, the specific steps of S4 are:
[0031] S41, using the input characteristic variables in the historical power load data training set, calculates the regression coefficients through least squares fitting, and establishes a linear regression model;
[0032] S42, using the linear regression model to obtain the initial prediction value of the training set.
[0033] Furthermore, the specific steps of S5 are:
[0034] S51, extracting test set data from the data preprocessing module, including input feature variables and target values;
[0035] S52, input the input feature variables in the test set into the linear regression model, and calculate the output value, that is, the initial prediction result of the linear regression.
[0036] Furthermore, the specific steps of S6 are:
[0037] S61, using formula Calculate the residual for each sample;
[0038] Where, is the actual load value, is the predicted value of the linear regression model, is the residual;
[0039] S62, the residual values of all samples are sorted into a residual sequence, which is used as the target value of the subsequent genetic programming model.
[0040] Furthermore, the specific steps of S9 are:
[0041] S91, a tournament selection method is used in the population to randomly select a number of individuals to form a group, compare their fitness values, and select the individual with higher fitness as the parent;
[0042] S92, crossover operation: randomly select two parent individuals, randomly select a crossover point in their GP trees, and exchange their subtrees to generate new offspring individuals;
[0043] S93, mutation operation: perform mutation operation on offspring individuals according to a certain probability, randomly select nodes in the GP tree, replace them with new functions or variable subtrees, or modify the operator or constant value of the current node;
[0044] S94, continuously generates offspring through crossover and mutation operations until the set population size is reached;
[0045] S95, replace the current population with the generated offspring to form a new generation of population.
[0046] The present invention also discloses a short-term power load forecasting method and system based on linear regression and genetic programming symbolic regression, comprising:
[0047] A data acquisition module is used to obtain historical load data of the power system;
[0048] The data preprocessing module preprocesses historical power load data, constructs input feature variables and target values using a sliding window method, captures the time series characteristics of short-term power load, improves the expressiveness of data samples, and provides high-quality data support for subsequent linear regression and genetic programming training and prediction;
[0049] Linear regression module, which uses linear regression to model the power load and calculate the residual; the residual is used as the target value of the genetic programming model;
[0050] Genetic programming module, which uses genetic programming to fit the residuals; optimizes the model through operations such as selection, crossover and mutation, thereby improving the fitting accuracy of the residuals;
[0051] The evaluation module evaluates the performance of the final model, using the root mean square error evaluation indicator, focusing on verifying the fitting effect of genetic programming on the residuals;
[0052] The test module evaluates the prediction effect of the genetic programming model on the test set and combines the prediction results of the genetic programming model with the prediction results of the linear regression model to obtain the final load forecast results.
[0053] The beneficial effects of the present invention are:
[0054] 1. This paper proposes a hybrid model combining linear regression and genetic programming symbolic regression in short-term power load forecasting. Linear regression is used to capture the linear trend of the load, and genetic programming is used to fit the residuals, thereby taking into account both the prediction accuracy and the interpretability of the model, and improving the ability to characterize the nonlinear characteristics of the power load.
[0055] 2. The present invention constructs a symbolic regression function set that includes basic arithmetic operators and nonlinear functions, which enhances the model's adaptability to dynamic changes and complex load patterns; the reasonable function set design effectively alleviates the slow evolution problem in the traditional genetic programming evolution process and improves training efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION
[0057] The present invention will be further described below with reference to the accompanying drawings.
[0058] like Figure 1 As shown, the present invention is a short-term power load forecasting method based on linear regression and genetic programming symbolic regression, comprising the following steps:
[0059] S1, obtain historical power load data;
[0060] S2, using a sliding window to pre-process the acquired historical power load data and divide it into input feature variables and target values; the specific steps are:
[0061] S21, set the length W of the sliding window, that is, the number of consecutive data points contained in each window;
[0062] S22, using a sliding window to sequentially extract W consecutive data points from the historical power load data as input feature variables;
[0063] S23, for each sliding window, the first data point immediately after the sliding window is taken as the target value, i.e., the predicted value;
[0064] S24, by sliding the window on the time series with a fixed step size of 1, extracting the feature variables and target values one by one.
[0065] S3, dividing the preprocessed power load data into a training set and a test set;
[0066] S4, use linear regression to model the training set data and obtain the initial prediction value of the training set; the specific steps are:
[0067] S41, using the input characteristic variables in the historical load data training set, calculate the regression coefficients through least squares fitting, and establish a linear regression model;
[0068] S42, using the linear regression model to obtain the initial prediction value of the training set.
[0069] S5: Apply the constructed linear regression model to the test set data to obtain the initial prediction value of the test set; the specific steps are:
[0070] S51, extracting test set data from the data preprocessing module, including input feature variables and target values;
[0071] S52, input the input feature variables in the test set into the linear regression model, and calculate the output value, that is, the initial prediction result of the linear regression, which represents the direct prediction of the linear regression model for the test set.
[0072] S6, calculate the residuals of the linear regression model; the specific steps are:
[0073] S61, using formula Calculate the residual for each sample;
[0074] Where, is the actual load value, is the predicted value of the linear regression model, is the residual;
[0075] S62, the residual values of all samples are sorted into a residual sequence, which is used as the target value of the subsequent genetic programming model.
[0076] S7, initialize a population using the search space constructed by inputting feature variables, function sets and random numbers from the training set;
[0077] S8, evaluates the fitness of individuals in the population through root mean square error;
[0078] S9, using crossover and mutation operations to generate offspring; the specific steps are:
[0079] S91, a tournament selection method is used in the population to randomly select a number of individuals to form a group, compare their fitness values, and select the individual with higher fitness as the parent;
[0080] S92, crossover operation: randomly select two parent individuals, randomly select a crossover point in their expression trees, and exchange their subtrees to generate new child individuals;
[0081] S93, mutation operation: perform mutation operation on offspring individuals according to a certain probability, randomly select nodes in the expression tree, replace them with new functions or variable subtrees, or modify the operator or constant value of the current node;
[0082] S94, continuously generates offspring through crossover and mutation operations until the set population size is reached;
[0083] S95, replace the current population with the generated offspring to form a new generation of population.
[0084] S10, directly copy the best offspring individuals to the next generation;
[0085] S11, evaluates the fitness of individuals in the population through root mean square error;
[0086] S12, judging whether the conditions for terminating the iteration are met; if the conditions are not met, turning to S9; if the conditions are met, turning to S13;
[0087] S13, the best individual obtained from the training set is tested on the test set for the short-term power load forecasting scenario;
[0088] S14, adding the preliminary prediction value of the linear regression model and the prediction value of the residual of the genetic programming model to obtain the final load forecast result.
[0089] The hybrid model provided by the present invention can provide good interpretability, and the generated symbolic expression reveals the potential laws of load changes.
[0090] The present invention provides a short-term power load forecasting system combining linear regression and genetic programming symbolic regression, comprising:
[0091] A data acquisition module is used to obtain historical load data of the power system;
[0092] Data preprocessing module, preprocessing historical power load data;
[0093] The linear regression module first uses linear regression to model the power load and calculates the residual; the residual is used as the target value of the genetic programming model;
[0094] A genetic programming module uses genetic programming to fit the residuals; optimizes the model through selection, crossover and mutation operations to improve the fitting accuracy of the residuals;
[0095] The evaluation module evaluates the performance of the final model, using the root mean square error evaluation indicator, focusing on verifying the fitting effect of genetic programming on the residuals;
[0096] The test module evaluates the prediction effect of the genetic programming model on the test set and adds the prediction results of the genetic programming model to the prediction results of the linear regression model to obtain the final power load prediction results.
[0097] To further illustrate the superiority of the present invention in the short-term power load forecasting scenario, Table 1 shows the results obtained by the method of the present invention and the decision tree (DT), random forest (RF), linear regression (LR) and support vector machine (SVM) methods in the short-term power load forecasting scenario.
[0098] Table 1 Comparison of experimental results of power load test set data
[0099]
[0100] The experimental results on the test set in the short-term power load forecasting scenario are given in the embodiment. The present invention adopts the standard GP setting, including 50 iterations, a population size of 512, a crossover rate of 0.89, a mutation rate of 0.1, and initializes the population through the tournament selection mechanism and the Ramped-Half & Half method. The parameter settings are shown in Table 2. The experiment uses 4 groups of data sets with different load ranges and time resolutions. The basic information of the data sets is shown in Table 3. The adaptability and robustness of the method are verified through 30 independent experiments, showing a prediction performance that is superior to that of traditional methods. Comparative analysis shows that in most cases, the method of the present invention provides higher interpretability and excellent prediction effects. In particular, when faced with complex high-load changes, genetic programming shows stronger adaptability and higher prediction accuracy. All comparative experimental results are verified by significance tests.
[0101] Table 2 Parameter settings
[0102]
[0103] Table 3 Basic information of the dataset
[0104]
[0105] Although the present invention has been described in detail above using general descriptions and specific embodiments, modifications and improvements may be made based on the present invention. The above descriptions are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Other changes and modifications made by those skilled in the art without departing from the spirit and scope of protection of the present invention are also included within the scope of protection of the present invention.
Claims
1. A short-term power load forecasting method combining linear regression and genetic programming symbolic regression, characterized in that: The following steps are involved: S1, obtain historical power load data; S2, using a sliding window to preprocess the acquired historical power load data and divide it into input feature variables and target values; S3, dividing the preprocessed power load data into a training set and a test set; S4, use linear regression to model the training set data and obtain the initial prediction value of the training set; S5, the constructed linear regression model is applied to the test set data to obtain the initial prediction value of the test set; S6, calculate the residuals of the linear regression model; S7, initialize a population using the search space constructed by inputting feature variables, function sets and random numbers from the training set; S8, evaluates the fitness of individuals in the population through root mean square error; S9, uses crossover and mutation operations to generate offspring; S10, directly copy the best offspring to the next generation; S11, evaluates the fitness of individuals in the population through root mean square error; S12, judging whether the conditions for terminating the iteration are met; If the termination condition is not met, go to S9; If the termination condition is met, go to S13; S13, the best individual obtained from the training set is tested on the test set for the short-term power load forecasting scenario; S14, adding the initial prediction value of the linear regression model and the prediction value of the residual of the genetic programming model to obtain the final power load prediction result.
2. The short-term power load forecasting method combining linear regression and genetic programming symbolic regression according to claim 1 is characterized in that: The specific steps of S2 are: S21, set the length W of the sliding window, that is, the number of consecutive data points contained in each window; S22, using a sliding window to sequentially extract W consecutive data points from the historical power load data as input feature variables; S23, for each sliding window, the first data point immediately after the sliding window is taken as the target value, i.e., the predicted value; S24, by sliding the window on the time series with a fixed step size of 1, extracting the input feature variables and target values one by one.
3. The short-term power load forecasting method combining linear regression and genetic programming symbolic regression according to claim 1 is characterized in that: The specific steps of S4 are: S41, using the input characteristic variables in the historical power load data training set, calculates the regression coefficients through least squares fitting, and establishes a linear regression model; S42, using the linear regression model to obtain the initial prediction value of the training set.
4. The short-term power load forecasting method combining linear regression and genetic programming symbolic regression according to claim 1 is characterized in that: The specific steps of S5 are: S51, extracting test set data from the data preprocessing module, including input feature variables and target values; S52, input the input feature variables in the test set into the linear regression model, and calculate the output value, that is, the initial prediction result of the linear regression.
5. The short-term power load forecasting method combining linear regression and genetic programming symbolic regression according to claim 1 is characterized in that: The specific steps of S6 are: S61, using formula Calculate the residual for each sample; Where, is the actual load value, is the predicted value of the linear regression model, is the residual; S62, the residual values of all samples are sorted into a residual sequence, which is used as the target value of the subsequent genetic programming model.
6. The short-term power load forecasting method combining linear regression and genetic programming symbolic regression according to claim 1 is characterized in that: The specific steps of S9 are: S91, a tournament selection method is used in the population to randomly select a number of individuals to form a group, compare their fitness values, and select the individual with higher fitness as the parent; S92, crossover operation: randomly select two parent individuals, randomly select a crossover point in their GP trees, and exchange their subtrees to generate new offspring individuals; S93, mutation operation: perform mutation operation on offspring individuals according to a certain probability, randomly select nodes in the GP tree, replace them with new functions or variable subtrees, or modify the operator or constant value of the current node; S94, continuously generates offspring through crossover and mutation operations until the set population size is reached; S95, replace the current population with the generated offspring to form a new generation of population.
7. A short-term power load forecasting system combining linear regression and genetic programming symbolic regression, characterized in that: include: A data acquisition module is used to obtain historical load data of the power system; Data preprocessing module, preprocessing historical power load data; A linear regression module, which uses linear regression to model the power load and calculate the residual; the residual is used as the target value of the genetic programming model; A genetic programming module uses genetic programming to fit the residuals; optimizes the model through selection, crossover and mutation operations to improve the fitting accuracy of the residuals; The evaluation module evaluates the performance of the final model, using the root mean square error evaluation indicator, focusing on verifying the fitting effect of genetic programming on the residuals; The test module evaluates the prediction effect of the genetic programming model on the test set and adds the prediction results of the genetic programming model to the prediction results of the linear regression model to obtain the final power load prediction results.