Two-stage short-term electric load forecasting method based on feature selection and dimensionality reduction clustering
Patent Information
- Application Number
- CN202311398874.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-26
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-10-26
AI Technical Summary
[0005](2)电力负荷的不稳定性、随机性、冗余性和非线性等特点导致预测误差的增大
[0061] (1) After clustering, the correlation performance of historical load and local relationship of influencing factors is calculated to extract a better feature set.
Smart Images

Figure CN117713037B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of time series forecasting and relates to a two-stage short-term power load forecasting method based on feature selection and dimensionality reduction clustering. Background Technology
[0002] Short-term power load forecasting refers to predicting power load over a relatively short period. Its accuracy significantly impacts the economic and social benefits of power companies. Therefore, researching ways to reduce the error in short-term power load forecasting is of great importance in ensuring the reliability and stability of power supply.
[0003] Given the importance of short-term power load forecasting, the current problems are analyzed from three main aspects:
[0004] (1) Feature selection methods for influencing factors neglect local relationships across different time periods. Short-term power load forecasting is influenced by various factors such as historical load, time, and weather. Therefore, to improve forecast accuracy, it is necessary to fully explore the relationship between load and various influencing factors and select the most suitable feature set for forecasting. Most studies have undergone multiple feature selections to screen for the optimal feature set to improve forecast accuracy. However, these methods only consider the global relationship between historical load and various factors and utilize them in the same way across different time periods.
[0005] (2) The instability, randomness, redundancy, and nonlinearity of power load lead to increased prediction errors. To address these issues, dimensionality reduction and clustering algorithms have been widely applied in power load forecasting. Some studies use daily weather factors as clustering criteria, but this clustering method struggles to distinguish the same load data under different weather conditions. Other studies employ principal component analysis (PCA) for dimensionality reduction and clustering based on daily load, which improves the stability of load data, but PCA has limitations when handling nonlinear data.
[0006] (3) Prediction methods combining clustering algorithms rely on the actual data of the date to be predicted. Current research mostly determines the category and date information of the date to be predicted by calculating the distance between the actual data of the date to be predicted and the cluster centers, thereby evaluating the accuracy of each prediction model. These works have verified the superiority of clustering algorithms and can effectively improve prediction accuracy, but in practical applications, they do not provide the actual data of the date to be predicted. Summary of the Invention
[0007] In view of this, the purpose of this invention is to provide a two-stage short-term power load forecasting method based on the maximum information coefficient (MIC), t-distributed stochastic neighbor embedding (TSNE), and k-means clustering coupled with t-kmeans.
[0008] To achieve the above objectives, the present invention provides the following technical solution:
[0009] A two-stage short-term power load forecasting method based on feature selection and dimensionality reduction clustering, using a two-stage forecasting framework:
[0010] First-stage prediction framework:
[0011] S1: Data Acquisition and Processing: Acquire historical power load datasets and corresponding weather factor datasets, perform preprocessing, remove outlier data, and divide the dataset into test, training, and validation sets;
[0012] S2: Feature Generation: Generate similar time point features using the preprocessed historical power load dataset to expand the feature set;
[0013] S3: Global Feature Selection: The correlation coefficients of historical load, weather and similar time points of the entire data sample are calculated using the maximum information coefficient (MIC), and feature selection is performed to obtain the optimal feature set.
[0014] S4: Preliminary Model Prediction: Build a machine learning model and optimize parameters using the data from step S3, set the prediction time length, select the optimal model as the prediction result for the first stage based on the evaluation indicators, and label the prediction points with date labels in chronological order, waiting for input into the second stage;
[0015] Second-stage prediction framework:
[0016] S5: Data Input: Input the historical power load dataset and the prediction results of the first stage into the prediction framework of the second stage;
[0017] S6: Dimensionality Reduction and Clustering: The t-kmeans method, which combines t-distributed random nearest neighbor embedding and k-means coupling, is used to reduce the dimensionality of the daily load data in step S5. This reduces the dimensionality of the historical load data and transforms the original data into multiple electricity consumption patterns with small differences within each class and large differences outside each class, and the time may not be continuous. Evaluation indicators are then calculated and visualized.
[0018] S7: Clarify the forecast date for each electricity consumption mode: Using the date label of the forecast result in step S4, clarify the actual forecast time length and forecast date for each electricity consumption mode, delete the forecast result in step S4 and keep only the date label;
[0019] S8: Local Feature Selection: The correlation coefficients of historical load, weather and similar time points for each electricity consumption pattern are calculated using the maximum information coefficient (MIC), and feature selection is performed to obtain the optimal feature set;
[0020] S9: Final prediction by the model: Using the data from step S8, a machine learning model and parameter optimization are established for each electricity consumption mode to make predictions. The model with the best evaluation index is selected as the prediction result. The prediction time length and prediction date of each electricity consumption mode are obtained from steps S4 and S7 and superimposed to form the final prediction result.
[0021] Furthermore, in step S1, all datasets are sampled and statistically analyzed every 15 minutes. Weather features include temperature, humidity, visibility, perceived temperature, pressure, wind speed, and dew point. The ratio of training set, validation set, and test set is 7:2:1.
[0022] Furthermore, in step S2, load data for the kd days prior to each historical load point are obtained.
[0023] Furthermore, step S3 specifically includes the following steps:
[0024] S31: Construct a feature selection dataset using the data from S2, including historical electricity load. Weather factors And similar time point features T, where L represents n samples per day, for a total of m days; W represents u samples per day, for a total of m days;
[0025] S32: The correlation coefficients of historical load and influencing factors are calculated using the maximum information coefficient (MIC). The two-dimensional space U and V are divided into u and v segments respectively, forming a u×v grid G. Different partitioning methods will generate different Gs. The MIC calculation formula is:
[0026]
[0027] In the formula, I * (D s (u,v) represents the feature selection dataset D. s Given the maximum mutual information in partition G, B(n) is a subset of D. s The upper limit of the medium grid partitioning, when B(n) = n 0.6 This is the optimal number of grid divisions;
[0028] Based on the MIC calculation results, features with high correlation are retained, while those without are discarded, thus obtaining the optimal feature set D for global relationships, with the following structure:
[0029]
[0030] In the formula, D is derived from L and the preferred similar time point features. and preferred weather characteristics Composition, where p and q are the number of preferred features.
[0031] Furthermore, step S4 specifically includes the following steps:
[0032] S41: Design four different feature input schemes and input them into Long Short-Term Memory (LSTM), Random Forest (RF), and Support Vector Regression (SVR) models respectively to verify the rationality of feature selection;
[0033] S42: Root Mean Square Error (RMSE), Mean Absolute Error (MAE), and Mean Absolute Percentage Error (MAPE) are selected as evaluation indicators for the load forecasting model. The specific formulas for the evaluation indicators are as follows:
[0034]
[0035]
[0036]
[0037] In the formula, y is the actual value. The value is the predicted value, and n is the total number of samples.
[0038] S43: Select the prediction model with the best evaluation index as the first-stage prediction result K, and label it with date tags V in chronological order.
[0039]
[0040]
[0041] In the formula, the preliminary prediction result K represents a total of e days of prediction, with n samples per day; the date label V represents the date information label corresponding to the prediction result.
[0042] Furthermore, in step S5, the historical power load dataset and the prediction results of the first stage are input into the prediction framework of the second stage in chronological order.
[0043] Furthermore, step S6 specifically includes the following steps:
[0044] S61: Input the sample data L and K from step S5 into the t-kmeans dimensionality reduction clustering algorithm to obtain the dimensionality-reduced loading data L. * :
[0045]
[0046] In the formula, the first m rows are the dimensionality reduction results of L, and the last m+e rows are the dimensionality reduction results of K;
[0047] For the dimension-reduced L * Clustering is performed to extract multiple electricity consumption patterns with small intra-cluster differences and large inter-cluster differences. From the first stage V, the clustering results clearly define the category and date information of the day to be predicted. The low-dimensional data is then restored, and the preliminary prediction result K is removed to obtain the electricity consumption pattern C.
[0048] C = (Lc Tc Wc)
[0049] In the formula, c (c = 1, 2, ..., ω) represents the cluster category, and there are a total of ω clusters; C contains the historical load, similar time point characteristics, and meteorological characteristics corresponding to each type of electricity consumption pattern in the S5 data;
[0050] S62: Calculate the silhouette coefficient, an evaluation index of the clustering method, and visualize the electricity consumption curves of each electricity consumption pattern using matplotlib. Analyze the electricity consumption patterns and trends, evaluate the rationality of the clustering method, and select an appropriate number of clusters.
[0051] Furthermore, step S7 specifically includes the following steps:
[0052] S71: Delete the preliminary prediction result K containing step S4 in each power consumption mode, and only keep the date label V;
[0053] S72: Determine the time length and date to be predicted for each type based on the date label V containing step S4 in each power consumption mode.
[0054] Furthermore, in step S8, MIC is used again to filter the correlation between features in each power consumption mode after steps S5-S7, thereby obtaining the optimal feature set D. * :
[0055]
[0056] In the formula, D *Includes historical load, best similar time point characteristics, and best weather characteristics for each type of electricity consumption pattern. The composition is as follows: λ is the number of samples for each type of load, and α and β represent the number of optimal features for each type, respectively.
[0057] Furthermore, step S9 specifically includes the following steps:
[0058] S91: Similar to step S4, design four different feature input schemes, select multiple models to predict each electricity consumption mode separately, and use the real data of the prediction point date label in the first stage as the test set for each electricity consumption mode to evaluate the accuracy.
[0059] S92: Select the model with the highest evaluation index as the prediction result, and superimpose the prediction results of each category to obtain the final prediction result.
[0060] The beneficial effects of this invention are as follows:
[0061] (1) After clustering, the correlation performance of historical load and local relationship of influencing factors is calculated to extract a better feature set.
[0062] (2) The t-kmeans algorithm can effectively handle high-dimensional nonlinear load data and improve the clustering quality of samples.
[0063] (3) The two-stage prediction method solves the problem of ambiguous prediction dates after clustering and improves the practicality of clustering algorithms in this field of load prediction.
[0064] (4) The proposed method framework can further improve the prediction accuracy of each benchmark model.
[0065] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0066] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:
[0067] Figure 1 This is a diagram of the first-stage prediction framework.
[0068] Figure 2 This is a diagram of the prediction framework for the second stage.
[0069] Figure 3 A temporal feature graph of the original sequence;
[0070] Figure 4 This is a comparison chart of the prediction results of different models in the first stage;
[0071] Figure 5 A comparison chart of the profile coefficients of various clustering methods;
[0072] Figure 6 The results of the clustering are shown in the figure, where (a) and (b) are the first type of load curve and the second type of load curve, respectively;
[0073] Figure 7 The data feature relationship diagrams for different electricity consumption modes in the second stage are shown, where (a) is the time feature correlation diagram for electricity consumption mode 1 and (b) is the time feature correlation diagram for electricity consumption mode 2.
[0074] Figure 8 The following are the load forecast results for different electricity consumption modes in the second phase: (a) is the load forecast result for Monday under electricity consumption mode 1, and (b) is the load forecast result for Sunday under electricity consumption mode 2. Detailed Implementation
[0075] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0076] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0077] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0078] Please see Figures 1 to 8 This invention provides a two-stage short-term load forecasting method based on feature selection, daily load dimensionality reduction, and clustering. The method designs a novel forecasting structure that effectively addresses the problem of clustering algorithms relying on the actual data of the day to be predicted while improving forecast accuracy. The invention provides the following solution:
[0079] A two-stage short-term power load forecasting method based on feature selection and dimensionality reduction clustering, using a two-stage forecasting framework.
[0080] 1. First-stage load forecasting achieved
[0081] The first stage calculates the global relationships between historical loads and features to obtain an optimized feature set, thereby improving the accuracy of preliminary prediction results. This includes:
[0082] Obtain historical power load datasets and corresponding weather factor datasets, perform data preprocessing, and remove outlier data;
[0083] A new feature is generated from the preprocessed historical power load dataset, namely the similar time point feature, which is the load data of the 14 days before the current time point;
[0084] Historical power load, weather factors, and similar time point features are input into the prediction framework. Feature selection methods are used to calculate the global relationship between historical load and features to obtain an optimal feature set. Feature selection methods include MIC (Maximum Information Coefficient), Pearson correlation coefficient, and Kendall correlation coefficient. In this embodiment, MIC is used to calculate the correlation between features, remove features with low correlation, reduce data dimensionality, and obtain an optimal feature set D based on global relationships (since this is a complete dataset, it is a global relationship).
[0085] A time-series prediction model is constructed based on machine learning methods to predict the optimal feature set, obtain the prediction results, and evaluate them. The time-series prediction model can be LSTM, SVR, RF, GRU, LIGHTGBM, XGBOOST, etc. The model with the best evaluation index is selected as the prediction result of the first stage, and the prediction points are labeled with date labels in chronological order, waiting to be input into the second stage (the prediction in the first stage is equivalent to manually assigning date labels, which prepares for subsequent clustering prediction; otherwise, the prediction results after clustering cannot determine which day the prediction results belong to).
[0086] The first-stage prediction flowchart is as follows: Figure 1 As shown, the specific steps are as follows:
[0087] Step 1: Input regional load data and external influencing factor data into the prediction framework, assuming historical load, similar time point characteristics, and weather characteristics are as follows:
[0088]
[0089] In the formula, L represents n samples per day, for a total of m days; T represents the kd days prior to the current time point; and W represents u samples per day, for a total of m days.
[0090] Step 2: Calculate the MIC values for historical loads and influencing factors separately. If the correlation between the two is high, retain them; otherwise, discard them. The structure of the optimal feature set D based on global relationships is as follows:
[0091]
[0092] In the formula, D is composed of L, preferred similar time point features, and preferred weather features. Composition, where p and q are the number of preferred features.
[0093] Step 3: Train the model using D to complete load forecasting and obtain preliminary forecast results K and date labels V:
[0094]
[0095]
[0096] In the formula, the preliminary prediction result K represents a total of e days of prediction, with n samples per day; the date label V represents the date information label corresponding to the prediction result.
[0097] 2. Implementation of the second phase of load forecasting
[0098] In the second stage, considering the nonlinear characteristics of the load, a dimensionality reduction algorithm is used to reduce the dimensionality of the historical load. A clustering algorithm is then used to cluster the historical load and preliminary prediction results based on daily load. After clustering, the original data is transformed into multiple electricity consumption patterns with small intra-cluster differences and large inter-cluster differences. In this embodiment, the t-kmeans method, which couples t-distributed random nearest neighbor embedding with k-means, is used to perform daily load dimensionality reduction and clustering on the data from step S5. This reduces the dimensionality of the historical load data, transforming the original data into multiple electricity consumption patterns with small intra-cluster differences and large inter-cluster differences, and not necessarily continuous over time. Evaluation indicators are calculated and visualized; the category and date information of the day to be predicted are clarified. After clustering, the MIC algorithm is used again to obtain the optimal feature set of local relationships between historical load and various influencing factors, and a load prediction model for each category is obtained, further improving the prediction accuracy. This includes:
[0099] The historical power load dataset and the prediction results from the first stage are input into the prediction framework for the second stage in chronological order.
[0100] The t-kmeans method, which combines t-distributed random nearest neighbor embedding with k-means, is used to perform daily load dimensionality reduction and clustering on the data in step S5. This reduces the dimensionality of historical load data and transforms the original data into multiple electricity consumption patterns with small differences within each class and large differences outside each class, and whose time is not necessarily continuous. Evaluation indicators are calculated and visualized for analysis. The date information to be predicted for each electricity consumption pattern is clearly defined.
[0101] After the original time series data is divided into multiple classes, the MIC correlation can be calculated for the historical power load, weather factors and similar time points of each class, and the most relevant features in each class can be selected to obtain the optimal feature set based on local relationships (since the original data becomes several classes after clustering, each class is a local, and the MIC is calculated for each class to obtain the optimal feature set).
[0102] Forecast and evaluate each electricity consumption pattern separately;
[0103] The model with the highest evaluation index is selected as the prediction result, and the prediction results of each category are superimposed to obtain the final prediction result.
[0104] The second-stage prediction flowchart is as follows: Figure 2 As shown, the specific steps are as follows:
[0105] Step 1: Input the sample data L and K from step S5 into the t-kmeans dimensionality reduction clustering algorithm to obtain the dimensionality-reduced loading data L. * :
[0106]
[0107] In the formula, the first m rows are the dimensionality reduction results of L, and the last m+e rows are the dimensionality reduction results of K;
[0108] For the dimension-reduced L * Clustering is performed to extract multiple electricity consumption patterns with small intra-cluster differences and large inter-cluster differences. From the first stage V, the clustering results clearly define the category and date information of the day to be predicted. The low-dimensional data is then restored, and the preliminary prediction result K is removed to obtain the electricity consumption pattern C.
[0109] C = (Lc Tc Wc)
[0110] In the formula, c (c = 1, 2, ..., ω) represents the cluster category, and there are a total of ω clusters; C contains the historical load, similar time point characteristics, and meteorological characteristics corresponding to each type of electricity consumption pattern in the S5 data;
[0111] Step 2: Calculate the silhouette coefficient, an evaluation index of the clustering method, and use matplotlib to visualize the electricity consumption curves of each electricity consumption pattern. Analyze the electricity consumption patterns and trends, evaluate the rationality of the clustering method, and select an appropriate number of clusters.
[0112] Step 3: Delete the preliminary prediction result K from step S4 in each power consumption mode, and only keep the date label V;
[0113] Step 4: Based on the date label V containing the date from step S4 in each electricity consumption mode, determine the time length and date to be predicted for each type.
[0114] Step 5: After dividing the original sequence into multiple classes, the local relationship between historical load and external factors can be analyzed. The most relevant features between the two are then selected using MIC again, thus obtaining the optimal feature set D. * :
[0115]
[0116] In the formula, D * Includes historical load, best similar time point characteristics, and best weather characteristics for each type of electricity consumption pattern. The composition is as follows: λ is the number of samples for each type of load, and α and β represent the number of optimal features for each type, respectively.
[0117] Step 6: Predict each electricity consumption pattern separately, and then combine them to form the final prediction result.
[0118] Experimental Analysis: This invention uses a load dataset from May 4th to August 28th, 2020, from a specific location to verify the effectiveness of the method. In the experiment, data from May 4th to August 23rd was used as the training set, and data from the last week was used as the test set. This dataset includes various influencing factors such as historical load, time, temperature, humidity, visibility, and perceived temperature, with a sampling interval of 15 minutes, totaling 96 samples per day. To ensure consistency across all data dimensions, each sample was normalized.
[0119] Phase 1 Experiment:
[0120] (1) Use the MIC method to screen the globally relevant features between historical loads and features to obtain the preferred feature set.
[0121] (2) Four different feature input schemes were designed and input into the Long Short-Term Memory (LSTM), Random Forest (RF) and Support Vector Regression (SVR) models respectively to verify the rationality of feature selection and select the prediction model with the best evaluation index as the preliminary prediction result.
[0122] Phase Two Experiment:
[0123] (1) Compare various dimensionality reduction and clustering methods and analyze the characteristics of each electricity consumption mode.
[0124] (2) Use the MIC method to filter the historical load and the correlation features between features after clustering to obtain the optimal feature set.
[0125] (3) Compare the prediction errors of LSTM, RF and SVR under the framework of this invention to verify the effectiveness of the method of this invention.
[0126] Evaluation Metric for Clustering Algorithms: To evaluate the effectiveness of clustering algorithms, this invention uses the silhouette coefficient as an evaluation metric. The silhouette coefficient is an indicator used to measure the quality of clustering; a value closer to 1 indicates a better clustering effect.
[0127]
[0128] In the formula, s1 is the similarity between the sample and its own cluster, s2 is the similarity between the sample and other clusters, and S is the sample silhouette coefficient.
[0129] Evaluation metrics for forecasting models: In the field of load forecasting, the root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) are commonly used as evaluation metrics for load forecasting models. The specific formulas are as follows:
[0130]
[0131]
[0132]
[0133] In the formula, y is the actual value. is the predicted value, and n is the total number of samples.
[0134] Phase 1 Validation:
[0135] MIC's preferred feature set acquisition:
[0136] The prediction accuracy in the first stage determines the category assignment of the clustering algorithm. Therefore, it is of great significance to improve prediction accuracy by analyzing the global relationship between historical loads and influencing factors and selecting the optimal feature set based on MIC. For factors at similar time points, in order to avoid changes in the time pattern caused by the influence of other external factors on historical loads, this stage only calculates the correlation between the current time and the past two weeks for each sample point.
[0137] Figure 3 The correlation between historical load and temporal characteristics is shown. It can be found that the current load is not only highly correlated with the previous few time points, but also highly correlated with the same time period on different days.
[0138] Table 1 shows the correlation between load and weather factors. Temperature is the most influential weather factor in this region, followed by perceived temperature and humidity, while pressure and dew point have a relatively small impact on load. Based on the above results, it can be concluded that time factors have a greater impact on load in this region, while meteorological factors have a relatively smaller impact. Therefore, in the overall relationship, time factors are an important influencing factor on load in this region. In this stage, the selection principle for the optimal feature set is: for features at similar time points, features with a MIC value greater than 0.7 are selected; for weather features, features with a MIC value greater than 0.3 are selected.
[0139] Table 1
[0140] temperature 0.47 humidity 0.3 visibility 0.16 perceived temperature 0.45 pressure 0.15 wind speed 0.22 Dew point 0.18
[0141] Preliminary load forecasting: To verify the effectiveness of the feature selection method in this stage, this invention designed four different feature input schemes to explore the impact of different feature combinations on the prediction results:
[0142] Option 1: Input only load data and ignore the influence of external factors.
[0143] Option 2: Input load data and characteristics of similar time points.
[0144] Option 3: Input load data and weather characteristics.
[0145] Option 4: Input load data, similar time point characteristics, and weather characteristics.
[0146] Table 2 shows the prediction results of various models over one week under different schemes. As the number of effective features increases, the errors of each scheme on multiple models decrease.
[0147] Table 2
[0148]
[0149] For example, the prediction results of different models in Scheme 4 are compared. Figure 4 As shown, LSTM exhibits better prediction performance under various feature inputs compared to other models. Therefore, this invention selects the prediction results of the LSTM model as the initial prediction results and labels each day's prediction data with dates from 1 to 7 days.
[0150] Second-stage validity verification:
[0151] Daily load dimensionality reduction and clustering using t-kmeans:
[0152] To verify the effectiveness of the dimensionality reduction and clustering methods proposed in this invention, historical load data and preliminary prediction results were clustered together, and the silhouette coefficients of k-means, pca-kmeans, and t-kmeans were compared to determine the number of clusters. Simultaneously, the method of determining the category of the day to be predicted in this invention was compared with the method of calculating the distance to the day to be predicted (denoted as T). Table 3 shows the silhouette coefficients of different clustering methods for 2 to 8 clusters. If only one result is found in the table, it indicates that the silhouette coefficients of the two methods are the same. The results show that all three clustering methods achieved the best clustering effect when k = 2.
[0153] Table 3
[0154]
[0155] Depend on Figure 5 It can be seen that the method of passing L and K together through t-kmeans is slightly better than the existing T method. This indicates that when the overall data distribution remains unchanged, the method of this invention can obtain more effective clustering results and does not require actual data for the day to be predicted, thus improving the practicality of clustering algorithms in the field of short-term load forecasting.
[0156] Therefore, based on the above analysis, the original time series can be divided into two categories, and L and K together, through dimensionality reduction and clustering, clearly define the category and date information of the date to be predicted. Specifically, Monday to Saturday of the date to be predicted belongs to the first category, and Sunday belongs to the second category. Figure 6 From (a) and (b) in the table, we can see that the average value of the first type of load curve is greater than that of the second type at all time points. The first type of electricity consumption curve is more compact and may be mostly load data on weekdays. The second type of electricity consumption curve is relatively loose and may be mostly load data on rest days or holidays.
[0157] Optimal Feature Set Acquisition by MIC: After clustering, MIC is used again to further analyze the local correlations between historical load, time factors, and weather factors, thereby obtaining the optimal feature set for each electricity consumption pattern. Since the clustered sequences themselves have stronger correlations, this stage calculates the correlation between the current and past 7 days for features at similar time points.
[0158] Depend on Figure 7 The results in (a) and (b) show that, compared to the unclustered clusters, Figure 3 The correlation between the first type of historical load and time factors was further improved, with the correlation exceeding 0.9 at some time points. This indicates that the daily electricity consumption time of the first type of electricity consumption pattern has strong regularity and conforms to the characteristics of weekday electricity consumption. The correlation between the second type of historical load and time characteristics is slightly lower. Figure 3 This indicates that the second type of electricity consumption pattern is relatively random compared to the first type, and is consistent with the electricity consumption characteristics of rest days or holidays.
[0159] Table 4 shows that both types of electricity consumption patterns exhibit a high correlation with temperature and perceived temperature. Compared to Table 1, the correlation of wind speed increases for the first type of electricity consumption pattern, while the correlation of humidity decreases for the second type. Therefore, clustering allows for a deeper analysis of the local relationships between historical loads and various influencing factors, thereby further improving prediction accuracy. The optimal feature set selection principle for this stage is as follows: for features at similar time points, features with a MIC value greater than 0.9 are selected for the first type, and features with a MIC value greater than 0.7 are selected for the second type; for weather features, features with a MIC value greater than 0.3 are selected for each type.
[0160] Table 4
[0161] temperature 0.65 0.51 humidity 0.5 0.28 visibility 0.26 0.18 perceived temperature 0.61 0.47 pressure 0.2 0.2 wind speed 0.35 0.24 Dew point 0.13 0.12
[0162] The optimal feature set is input into each prediction model and then superimposed to obtain the final result, as shown in Table 5. The first result represents the prediction error from Monday to Saturday, and the second result represents the prediction error for Sunday. Similarly, the feature input scheme in this stage is the same as in the first stage.
[0163] Table 5
[0164]
[0165] As can be seen from Table 5, the evaluation indicators of each electricity consumption mode in different schemes are better than those of the non-clustered method, and the method of the present invention further improves the prediction accuracy of each benchmark model. Figure 8Figures (a) and (b) show the prediction results for two electricity consumption patterns under Scheme 4. LSTM has the best prediction performance, with mape rates of 1.08% and 0.78%, respectively.
[0166] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A two-stage short-term power load forecasting method based on feature selection and dimensionality reduction clustering, characterized in that: Based on a two-stage prediction framework: First-stage prediction framework: S1: Data Acquisition and Processing: Acquire historical power load datasets and corresponding weather factor datasets, perform preprocessing, remove outlier data, and divide the dataset into test, training, and validation sets; S2: Feature Generation: Generate similar time point features using the preprocessed historical power load dataset to expand the feature set; S3: Global Feature Selection: The correlation coefficients of historical load, weather and similar time points of the entire data sample are calculated using the maximum information coefficient (MIC), and feature selection is performed to obtain the optimal feature set. S4: Preliminary Model Prediction: Build a machine learning model and optimize parameters using the data from step S3, set the prediction time length, select the optimal model as the prediction result for the first stage based on the evaluation indicators, and label the prediction points with date labels in chronological order, waiting for input into the second stage; Second-stage prediction framework: S5: Data Input: Input the historical power load dataset and the prediction results of the first stage into the prediction framework of the second stage; S6: Dimensionality Reduction and Clustering: The t-kmeans method, which combines t-distributed random nearest neighbor embedding and k-means coupling, is used to reduce the dimensionality of the daily load data in step S5. This reduces the dimensionality of the historical load data and transforms the original data into multiple electricity consumption patterns with small differences within each class and large differences outside each class, and the time may not be continuous. Evaluation indicators are then calculated and visualized. S7: Clarify the forecast date for each electricity consumption mode: Using the date label of the forecast result in step S4, clarify the actual forecast time length and forecast date for each electricity consumption mode, delete the forecast result in step S4 and keep only the date label; S8: Local Feature Selection: The correlation coefficients of historical load, weather and similar time points for each electricity consumption pattern are calculated using the maximum information coefficient (MIC), and feature selection is performed to obtain the optimal feature set; S9: Final prediction by the model: Using the data from step S8, a machine learning model and parameter optimization are established for each electricity consumption mode to make predictions. The model with the best evaluation index is selected as the prediction result. The prediction time length and prediction date of each electricity consumption mode are obtained from steps S4 and S7 and superimposed to form the final prediction result.
2. The two-stage short-term power load forecasting method based on feature selection and dimensionality reduction clustering according to claim 1, characterized in that: In step S1, all datasets are sampled and statistically analyzed every 15 minutes. Weather features include temperature, humidity, visibility, perceived temperature, pressure, wind speed, and dew point. The ratio of training set, validation set, and test set is 7:2:
1.
3. The two-stage short-term power load forecasting method based on feature selection and dimensionality reduction clustering according to claim 1, characterized in that: In step S2, load data for kd days prior to each historical load point are obtained.
4. The two-stage short-term power load forecasting method based on feature selection and dimensionality reduction clustering according to claim 1, characterized in that: Step S3 specifically includes the following steps: S31: Construct a feature selection dataset using the data from S2, including historical electricity load. Weather factors And similar time point features T, where L represents n samples per day, for a total of m days; W represents u samples per day, for a total of m days; S32: The correlation coefficients of historical load and influencing factors are calculated using the maximum information coefficient (MIC). The two-dimensional space U and V are divided into u and v segments respectively, forming a u×v grid G. Different partitioning methods will generate different Gs. The MIC calculation formula is: In the formula, I * (D s (u,v) represents the feature selection dataset D. s Given the maximum mutual information in partition G, B(n) is a subset of D. s The upper limit of the medium grid partitioning, when B(n) = n 0.6 This is the optimal number of grid divisions; Based on the MIC calculation results, features with high correlation are retained, while those without are discarded, thus obtaining the optimal feature set D for global relationships, with the following structure: D=(L Ti * Wi * ) In the formula, D is derived from L and the preferred similar time point features. and preferred weather characteristics Composition, where p and q are the number of preferred features.
5. The two-stage short-term power load forecasting method based on feature selection and dimensionality reduction clustering according to claim 1, characterized in that: Step S4 specifically includes the following steps: S41: Design four different feature input schemes and input them into Long Short-Term Memory (LSTM), Random Forest (RF), and Support Vector Regression (SVR) models respectively to verify the rationality of feature selection; S42: Root Mean Square Error (RMSE), Mean Absolute Error (MAE), and Mean Absolute Percentage Error (MAPE) are selected as evaluation indicators for the load forecasting model. The specific formulas for the evaluation indicators are as follows: In the formula, y is the actual value. The value is the predicted value, and n is the total number of samples. S43: Select the prediction model with the best evaluation index as the first-stage prediction result K, and label it with date tags V in chronological order. In the formula, the preliminary prediction result K represents a total of e days of prediction, with n samples per day; the date label V represents the date information label corresponding to the prediction result.
6. The two-stage short-term power load forecasting method based on feature selection and dimensionality reduction clustering according to claim 1, characterized in that: In step S5, the historical power load dataset and the prediction results of the first stage are input into the prediction framework of the second stage in chronological order.
7. The two-stage short-term power load forecasting method based on feature selection and dimensionality reduction clustering according to claim 1, characterized in that: Step S6 specifically includes the following steps: S61: Input the sample data L and K from step S5 into the t-kmeans dimensionality reduction clustering algorithm to obtain the dimensionality-reduced loading data L. * : In the formula, the first m rows are the dimensionality reduction results of L, and the last m+e rows are the dimensionality reduction results of K; For the dimension-reduced L * Clustering is performed to extract multiple electricity consumption patterns with small intra-cluster differences and large inter-cluster differences. From the first stage V, the clustering results clearly define the category and date information of the day to be predicted. The low-dimensional data is then restored, and the preliminary prediction result K is removed to obtain the electricity consumption pattern C. C = (Lc Tc Wc) In the formula, c (c = 1, 2, ..., ω) represents the cluster category, and there are a total of ω clusters; C contains the historical load, similar time point characteristics, and meteorological characteristics corresponding to each type of electricity consumption pattern in the S5 data; S62: Calculate the silhouette coefficient, an evaluation index of the clustering method, and visualize the electricity consumption curves of each electricity consumption pattern using matplotlib. Analyze the electricity consumption patterns and trends, evaluate the rationality of the clustering method, and select an appropriate number of clusters.
8. The two-stage short-term power load forecasting method based on feature selection and dimensionality reduction clustering according to claim 1, characterized in that: Step S7 specifically includes the following steps: S71: Delete the preliminary prediction result K containing step S4 in each power consumption mode, and only keep the date label V; S72: Determine the time length and date to be predicted for each type based on the date label V containing step S4 in each power consumption mode.
9. The two-stage short-term power load forecasting method based on feature selection and dimensionality reduction clustering according to claim 1, characterized in that: In step S8, the MIC is used again to filter the correlation between features in each power consumption mode after steps S5-S7, thereby obtaining the optimal feature set D. * : In the formula, D * Includes historical load, best similar time point characteristics, and best weather characteristics for each type of electricity consumption pattern. The composition is as follows: λ is the number of samples for each type of load, and α and β represent the number of optimal features for each type, respectively.
10. The two-stage short-term power load forecasting method based on feature selection and dimensionality reduction clustering according to claim 1, characterized in that: Step S9 specifically includes the following steps: S91: Design four different feature input schemes, select multiple models to predict each electricity consumption mode separately, and use the real data of the prediction point date label in the first stage as the test set for each electricity consumption mode to evaluate the accuracy. S92: Select the model with the highest evaluation index as the prediction result, and superimpose the prediction results of each category to obtain the final prediction result.
Citation Information
Patent Citations
Ultra-short-term power load prediction method
CN112418476A
Regional energy load power utilization mode mining algorithm based on two-stage integrated clustering
CN113935399A