A price prediction method and system based on clustering and mixed modeling
By using a clustering and hybrid modeling approach, and leveraging common calendar rules and K-means clustering, a separate prediction model is constructed. This solves the problem of low accuracy in holiday electricity price prediction in existing technologies, and achieves more efficient and accurate electricity price prediction.
Patent Information
- Application Number
- CN202610423076.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-01
- Publication Date
- 2026-06-26
AI Technical Summary
Existing electricity price forecasting methods suffer from poor adaptability and low accuracy when dealing with complex date patterns, especially holidays, and cannot accurately capture the differences in electricity price patterns across different holidays.
A clustering and hybrid modeling approach is adopted. Initial date classification is performed using common calendar rules. Combined with K-means clustering and the LightGBM algorithm, a separate prediction model is constructed to process electricity price data for weekdays, weekends, and holidays, forming a dedicated prediction model.
It significantly improves the accuracy and stability of electricity price forecasts during holidays, reduces forecast errors, and especially in holiday scenarios, the forecast results are more in line with reality, reducing redundant calculations and manual intervention in model training.
Smart Images

Figure CN122288772A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power system operation and market transaction technology, specifically relating to a method and system for electricity price prediction based on clustering and hybrid modeling. Background Technology
[0002] Electricity price forecasting plays a crucial role in power system operation and market transactions. Accurate electricity price forecasts help power companies optimize generation plans, reduce operating costs, and provide market participants with a basis for decision-making. However, electricity prices are influenced by a variety of complex factors, including load fluctuations, weather conditions, policies and regulations, market supply and demand, and changes in consumption patterns on special dates such as holidays and weekends. Especially on holidays and weekends, due to factors such as reduced industrial production activity and changes in residential lifestyles, electricity prices often exhibit fluctuation patterns and peak-valley characteristics that are quite different from those on weekdays.
[0003] Currently, electricity price forecasting methods are mainly divided into statistical methods, machine learning methods, and deep learning methods.
[0004] Statistical methods, including ARIMA autoregressive integral moving average model and exponential smoothing, are good at capturing linear relationships and seasonality in time series, but have limited ability to capture nonlinear patterns and complex external factors.
[0005] Machine learning methods, such as Support Vector Machines (SVM), Random Forest, and Gradient Boosting Trees (GGBM), can handle multi-dimensional features and capture a certain degree of non-linear relationships, exhibiting good generalization ability. LightGBM, as an efficient gradient boosting decision tree algorithm, performs exceptionally well in time series forecasting.
[0006] Deep learning methods, such as recurrent neural networks (RNNs) and their variant, long short-term memory networks (LSTMs), are capable of effectively learning long-term dependencies and complex nonlinear patterns in time series data, and have significant advantages in processing massive amounts of time series data.
[0007] K-Means clustering is an unsupervised learning algorithm used to divide a dataset into K clusters, such that data points within the same cluster have high similarity, while data points between different clusters have low similarity. In time series analysis, K-Means can be used to identify time series curves with similar patterns.
[0008] In existing technologies, some studies have used time clustering methods to improve the accuracy of electricity price or electricity consumption forecasts. The core idea is "classify first, then predict," meaning historical dates are first grouped according to pattern similarity, and then prediction models are built for different groups. Related existing technical solutions include: Chinese patent CN202110860141A discloses a short-term electricity price forecasting scheme based on the similarity day method and the Adaboost model. The scheme first collects historical load, electricity price, weather, season, and holiday data. Then, it uses the fuzzy C-means clustering (FCM) algorithm to cluster historical dates based on their daily attributes to find "similar days" similar to the predicted date. Subsequently, based on the clustering results, the system selects historical data belonging to the same category as the predicted date to construct a training sample set. Finally, this sample set is used to train the Adaboost ensemble learning model for electricity price forecasting.
[0009] Chinese patent CN120414503A, entitled "Residential Daily Electricity Consumption Prediction Scheme Based on Dynamic Clustering and Time-Series Fusion Network," aims to predict daily electricity consumption for residents. It first acquires historical electricity consumption time series and holiday characteristics of user groups, then uses a K-value clustering algorithm based on Dynamic Time Warping (DTW) to cluster the electricity consumption curves to identify user groups with similar electricity consumption behaviors. Subsequently, the clustered pattern labels, holiday data, and historical electricity consumption features are input into a complex Time-Series Fusion Converter (TFT) model to obtain the final predicted value.
[0010] The two existing technologies mentioned above, which use a single global model, have the following obvious drawbacks: The "one-size-fits-all" approach has poor adaptability: A single model attempts to fit all types of dates, including weekdays, weekends, and various holidays, using a single set of parameters. This leads to trade-offs between different patterns, failing to accurately capture the details of any particular pattern. Especially for holidays with limited data but unique patterns, their features are overwhelmed by the large amount of weekday data, resulting in a significant drop in prediction accuracy.
[0011] The handling of holiday patterns is crude: Some existing methods may simply treat all holidays as a single category, but this ignores the significant differences in electricity pricing patterns between different holidays, such as single-day holidays, the Spring Festival holiday, and the National Day holiday. For example, during the Spring Festival, factory shutdowns lead to a sharp drop in industrial electricity consumption, while during the National Day holiday, commercial and tourism electricity consumption may increase, resulting in completely different pricing patterns. A single model cannot distinguish these subtle differences. Summary of the Invention
[0012] This invention provides a method and system for predicting electricity prices based on clustering and hybrid modeling, in order to solve the technical problem that traditional methods in the prior art mostly use a single model, which has insufficient predictive ability under complex date patterns and is difficult to accurately predict electricity prices during holidays and rest days.
[0013] To achieve the above objectives, the present invention adopts the following technical solution: A method for predicting electricity prices based on clustering and hybrid modeling includes the following steps: Historical electricity price data is acquired, and based on public calendar rules, the historical electricity price data is initially categorized by date, and initial date category labels are generated; Historical electricity price data for the date to be predicted is filtered out. Based on the historical electricity price data for the date to be predicted, a daily electricity price pattern sample set is formed. The daily electricity price pattern sample set is clustered to generate cluster labels for the date to be predicted. Based on the clustering labels of the dates to be predicted and the initial date classification labels, a clustering category predictor is constructed to output the electricity price pattern category for the dates to be predicted. Using machine learning algorithms, based on the clustering labels of the dates to be predicted, corresponding prediction models are built for all historical electricity price data; Based on the electricity price pattern category of the date to be predicted, the corresponding prediction model is invoked, the features of the time to be predicted are extracted, and the predicted electricity price value is generated.
[0014] The process of acquiring historical electricity price data involves initial date classification based on public calendar rules, resulting in initial date classification labels. Specifically, this includes acquiring historical electricity price data and related influencing factor data, which includes timestamps, hours, days of the week, and months. The historical electricity price data and related influencing factor data are then cleaned and sorted in ascending order by timestamp. Based on the cleaned and sorted data, public calendar rules are used to initially classify dates, resulting in initial date classification labels of "weekdays," "weekends," "short holidays," and "long holidays" (holiday_type).
[0015] The process of filtering historical electricity price data for the dates to be predicted involves forming a daily electricity price pattern sample set based on the historical electricity price data for the dates to be predicted. Specifically, the historical electricity price data for the dates to be predicted is filtered from the historical electricity price data according to the initial date classification label. For all the historical electricity price data for the dates to be predicted, the 24-hour electricity price data for each day is taken as a daily electricity price pattern vector to form a daily electricity price pattern sample set.
[0016] The daily electricity price pattern sample set is standardized. The K-means unsupervised clustering algorithm is used to identify the similarity of all daily electricity price pattern vectors in the standardized daily electricity price pattern sample set. The standardized daily electricity price pattern sample set is clustered to generate N typical electricity price pattern clusters. A corresponding clustering label is assigned to each typical electricity price pattern cluster. The clusters of the N typical electricity price patterns are mapped to the standardized daily electricity price pattern sample set, and the clustering label Cluster_type of the date to be predicted is output, where the clustering label Cluster_type=-1 for the date not to be predicted.
[0017] The method involves constructing a cluster category predictor based on the clustering label of the date to be predicted and the initial date classification label, and outputting the electricity price pattern category for the date to be predicted. Specifically, a classification model is used, with the initial date classification label as the input feature and the clustering label of the date to be predicted as the input label. The classification model is trained to construct a cluster category predictor, which performs clustering and classification based on the input data and outputs the electricity price pattern category for the date to be predicted.
[0018] Machine learning algorithms are used to construct corresponding prediction models for all historical electricity price data based on the cluster labels of the dates to be predicted. Specifically, the LightGBM algorithm is used to construct a basic prediction model for all historical electricity price data that are not to be predicted, and for the historical electricity price data of the dates to be predicted, a separate electricity price prediction model is constructed for each cluster label of the date to be predicted.
[0019] The process involves identifying the electricity price pattern category based on the date to be predicted, calling the corresponding prediction model, extracting the time-specific features, and generating the predicted electricity price value. Specifically, based on the macro-calendar attributes of the date to be predicted, the initial date classification label based on public calendar rules, and the week number among the influencing factors of historical electricity price data, a clustering category predictor is used to perform clustering, outputting the electricity price pattern category for the date to be predicted. Based on the electricity price pattern category for the date to be predicted, the corresponding prediction model is intelligently matched from the prediction models for all dates, the time-specific features of the date to be predicted are extracted, input into the corresponding prediction model, and the predicted electricity price value for the date to be predicted is output.
[0020] A method for predicting electricity prices during holidays based on clustering and hybrid modeling includes the following steps: Historical electricity price data for holidays is selected from historical electricity price data. Based on the historical electricity price data for holidays, a daily electricity price pattern sample set is formed. The daily electricity price pattern sample set is clustered to generate holiday cluster labels. Based on the holiday clustering labels and the initial holiday classification labels, a clustering category predictor is constructed to output the holiday electricity price pattern category; Machine learning algorithms were used to construct corresponding prediction models for all historical electricity price data on non-holidays and historical electricity price data on holidays. Based on the holiday electricity price pattern category, the corresponding prediction model is called to extract the features of the holiday time and generate the predicted value of the holiday electricity price.
[0021] For the date to be predicted, it is determined whether it is a holiday. If it is a holiday, a clustering category predictor is used to generate a holiday electricity price pattern category. Based on the holiday electricity price pattern category, the prediction model corresponding to the holiday electricity price pattern category is called from all prediction models corresponding to the historical electricity price data of the holiday to make an electricity price prediction. If the date to be predicted is not a holiday, the prediction model of the historical electricity price data of non-holidays is directly called to make an electricity price prediction.
[0022] An electricity price forecasting system based on clustering and hybrid modeling includes an initial classification module, a deep clustering module, a clustering classification module, a separate hybrid model construction module, and an intelligent forecasting module. The initial classification module is used to acquire historical electricity price data, classify the historical electricity price data by initial date based on public calendar rules, and generate initial date classification labels; The deep clustering module is used to filter historical electricity price data for the date to be predicted, form a daily electricity price pattern sample set based on the historical electricity price data for the date to be predicted, cluster the daily electricity price pattern sample set, and generate cluster labels for the date to be predicted. The clustering and classification module is used to construct a clustering category predictor based on the clustering label of the date to be predicted and the initial date classification label, and output the electricity price pattern category of the date to be predicted; The separate hybrid model construction module is used to construct corresponding prediction models for all historical electricity price data using machine learning algorithms. The intelligent prediction module is used to call the corresponding prediction model based on the electricity price pattern category of the date to be predicted, extract the features of the date to be predicted, and generate the predicted electricity price value.
[0023] Compared with the prior art, the present invention has the following beneficial effects: This invention proposes an electricity price prediction method based on clustering and hybrid modeling. When classifying and labeling dates according to public calendar rules, a data cleaning operation is first performed to remove outliers. These outliers do not conform to the actual attributes of electricity prices, and the cleaned data accurately reflects the price situation corresponding to actual electricity consumption, avoiding interference from outliers in subsequent analysis. Next, the time-series data is sorted in ascending order by timestamp to strictly maintain the temporal correlation of electricity price data and prevent confusion of time period characteristics in subsequent analysis. After classification by different date types, the differences in basic electricity consumption scenarios for each type of date can be directly distinguished, anchoring a clear scenario direction for subsequent analysis. This allows subsequent modeling work to proceed efficiently based on the characteristics of the corresponding scenarios without needing to re-examine basic electricity consumption patterns.
[0024] Furthermore, a sample set is constructed by screening historical data for the dates to be predicted, ensuring a high degree of match between the samples and the predicted scenario, thus enhancing the relevance of subsequent analysis. The complete 24-hour electricity price is used as a vector to comprehensively cover the daily price fluctuation cycle, ensuring no key period's price characteristics are missed. Standardization scaling of electricity prices from different dates to the same range allows the clustering process to focus on the shape of price fluctuations rather than absolute price levels, avoiding interference from absolute price differences in pattern recognition. Using an unsupervised clustering algorithm to cluster the sample set uncovers deeper patterns in electricity price changes hidden behind the dates, overcoming the coarse-grained limitations of relying solely on calendar classification and providing more precise segmentation for subsequent modeling.
[0025] Furthermore, using initial classification labels and weekday features as input features, a classification model is trained to construct a clustering category predictor, which can establish a stable mapping relationship between macro-level date attributes and deep-seated electricity price patterns. This predictor can directly output the electricity price pattern category for the date to be predicted, eliminating the need to repeatedly perform clustering operations for each date, significantly reducing redundant computational steps and greatly improving the overall efficiency of the prediction process. Simultaneously, the predictor outputs categories based on historical clustering results, preventing inconsistencies in classification due to fluctuations in new data, ensuring the stability of category judgments, and providing a reliable basis for subsequent model calls.
[0026] Furthermore, separate prediction models are built for different clustering labels. Each model learns only from historical data corresponding to its pattern, ensuring that model parameters accurately adapt to the electricity price fluctuation patterns of that pattern and avoiding the problem of pattern ambiguity caused by mixing data from different patterns. Non-holiday data is separated from holiday data, and a separate basic prediction model is built for non-holiday data. This effectively avoids interference from the special patterns of holidays on the learning process of non-holiday models, allowing the basic model to focus on learning the electricity price change patterns during non-holidays. Model training is conducted using specific machine learning algorithms, fully leveraging the fitting capabilities of these algorithms. Compared to a single general model, the fitting error of each separate model is significantly reduced, and the prediction accuracy is significantly improved.
[0027] Furthermore, performing clustering operations on historical holiday data separately allows us to focus on unique electricity consumption behaviors during holidays and uncover exclusive electricity pricing patterns specific to those holidays. These unique patterns cannot be obtained through general data clustering. Based on the holiday clustering results, a dedicated clustering category predictor is built to further improve the accuracy of holiday electricity pricing pattern identification. A scenario-based calling logic is designed to accurately match the corresponding prediction model by determining whether the date to be predicted is a holiday. This targeted approach significantly reduces the error in holiday predictions, while the prediction stability of non-holiday models is also effectively improved because they do not incorporate holiday data.
[0028] Furthermore, intelligent model matching is achieved based on electricity price model categories. This automatically selects the appropriate model for the predicted date without manual intervention, eliminating manual judgment and matching steps and saving time. Relevant features for the predicted time are extracted, and these features are consistent with the input features during model training, ensuring the model can accurately utilize historical patterns for calculation. The extracted features are then input into the matched model, allowing it to fully leverage historical patterns that best fit the predicted scenario, resulting in a more realistic prediction with significantly reduced errors. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of a method for predicting electricity prices based on clustering and hybrid modeling in an embodiment of the present invention; Figure 2 This is a schematic diagram of a holiday electricity price prediction method based on clustering and hybrid modeling in an embodiment of the present invention; Figure 3 This is a schematic diagram showing the comparison curves between the prediction results of the method of the present invention and the traditional single LightGBM benchmark model and the actual electricity price in an embodiment of the present invention. Detailed Implementation
[0030] To further understand the content of this invention, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments are merely illustrative and not limiting of the invention.
[0031] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0032] Example 1 This embodiment proposes an electricity price prediction method based on clustering and hybrid modeling, such as... Figure 1 As shown, it includes the following steps: Historical electricity price data is acquired, and based on public calendar rules, the historical electricity price data is initially categorized by date, and initial date category labels are generated; Historical electricity price data for the date to be predicted is filtered out. Based on the historical electricity price data for the date to be predicted, a daily electricity price pattern sample set is formed. The daily electricity price pattern sample set is clustered to generate cluster labels for the date to be predicted. Based on the clustering labels of the dates to be predicted and the initial date classification labels, a clustering category predictor is constructed to output the electricity price pattern category for the dates to be predicted. Using machine learning algorithms, based on the clustering labels of the dates to be predicted, corresponding prediction models are built for all historical electricity price data; Based on the electricity price pattern category of the date to be predicted, the corresponding prediction model is invoked, the features of the time to be predicted are extracted, and the predicted electricity price value is generated.
[0033] Specifically, historical electricity price data is collected as the dependent variable for prediction, and data on the time-dimensional influencing factors of the electricity price data are simultaneously collected as feature independent variables. Feature sub-variables include timestamps, hours, days of the week, and months. The collected data undergoes data cleaning, including missing value processing and removal of abnormal data such as zero and negative values that do not conform to the actual attributes of electricity prices. After cleaning, the data is rearranged in ascending order by timestamp to ensure the continuity of the data's time sequence. Based on the statutory holidays and public holidays rules in the public calendar, each date in the historical electricity price data is initially categorized, and an initial date classification label (holiday_type) is assigned to each date. The classification label categories include "weekday," "weekend," "short holiday," and "long holiday."
[0034] From the historical electricity price data mentioned above, based on the initial date classification label holiday_type, historical electricity price data for the dates to be predicted are filtered. For all historical electricity price data for the dates to be predicted, the 24-hour electricity price data for each day is taken as a daily electricity price pattern vector to construct a daily electricity price pattern sample set. Subsequently, the daily electricity price pattern sample set is standardized to eliminate the interference of absolute price levels, so that the clustering process focuses on the pattern shape characteristics of electricity price fluctuations. Finally, the K-means unsupervised clustering algorithm is used to cluster the standardized daily electricity price pattern sample set, identify the similarity of all daily electricity price pattern vectors in the standardized daily electricity price pattern sample set, and generate clusters of N typical electricity price patterns, which are the N typical electricity price patterns in the historical electricity price data for all dates to be predicted, including "smooth valley type" and "sudden evening peak type". Further, a corresponding clustering label is assigned to each typical electricity price pattern cluster, and the clusters of the N typical electricity price patterns are mapped to the standardized daily electricity price pattern sample set to output the clustering label Cluster_type for the date to be predicted.
[0035] To effectively predict the electricity price on a given date, it is necessary to determine the electricity price pattern for that date. Therefore, this embodiment uses a K-nearest neighbor classifier, with the initial date classification label holiday_type and the weekday feature dayofweek as input features, and the cluster label Cluster_type of the date to be predicted as input label. The K-nearest neighbor classifier is trained to construct a cluster category predictor. Based on the input data, clustering is performed, and the most likely electricity price pattern cluster category Cluster_type is selected as the electricity price pattern category for the date to be predicted.
[0036] To further improve the prediction accuracy of electricity prices on the predicted date and address the technical problem of a single global model being unable to adapt to the fluctuation differences of different electricity price patterns and having large prediction errors, this embodiment abandons the traditional modeling approach of a single global model. Based on the electricity price pattern category and cluster label of the predicted date, a specialized, high-precision split-hybrid prediction model is trained. The specific implementation process is as follows: First, feature engineering is carried out. Combining the core influencing factors of electricity price prediction, rich and effective input features are constructed for the historical electricity price data of the predicted date and historical electricity price data of all dates, providing a high-quality input foundation for subsequent model training. The input features are shown in Table 1 below, including historical lagged electricity prices, hourly and weekday features, and initial date classification labels. Then, the model training process is initiated, adopting a categorized training strategy. Specifically, for all historical electricity price data of non-predicted dates, a basic prediction model is constructed to handle the prediction of electricity prices for non-predicted dates. For the historical electricity price data of the predicted date, the corresponding cluster label (Cluster_type = ...) is used. For each cluster label of the date to be predicted (0, 1, ..., N-1), a separate electricity price prediction model is constructed. All the above prediction models adopt the high-performance LightGBM machine learning algorithm to ensure the model's fitting ability and prediction efficiency. Among them, the dedicated prediction model for each date to be predicted only uses historical data under the corresponding cluster label for training, which can effectively avoid the interference of fluctuations between different electricity price patterns, and more accurately capture the inherent laws of price fluctuations, peak and trough occurrence periods and changing trends under the specific electricity price pattern, providing reliable model support for accurate electricity price prediction for subsequent dates to be predicted.
[0037] Table 1
[0038] Finally, based on the macro-calendar attributes of the date to be predicted, including its initial date classification label based on public calendar rules and the number of weeks in the influencing factors of historical electricity price data, a clustering category predictor is used to perform clustering, outputting the electricity price pattern category of the date to be predicted. Based on the electricity price pattern category of the date to be predicted, the corresponding prediction model is intelligently matched from the prediction models of all dates, the time features of the date to be predicted are extracted, input into the corresponding prediction model, and the predicted electricity price value of the date to be predicted is output.
[0039] Example 2 Based on the electricity price forecasting method based on clustering and hybrid modeling described in Example 1, this example proposes a holiday electricity price forecasting method based on clustering and hybrid modeling, such as... Figure 2 As shown, the specific implementation method is as follows: From the historical electricity price data obtained in Example 1, based on the initial date classification labels generated in Example 1, all historical electricity price data for holidays marked as short and long holidays are filtered out; the 24-hour electricity price data corresponding to each holiday date is used as an independent daily electricity price pattern vector to construct a daily electricity price pattern sample set specific to holidays; the sample set is standardized to eliminate the interference of absolute electricity price levels on different dates, so that the clustering process focuses on the pattern features of electricity price fluctuations; the K-means unsupervised clustering algorithm is used to cluster the standardized sample set, identify the similarity of holiday electricity price patterns, generate N typical holiday electricity price patterns, and assign a corresponding holiday clustering label Cluster_type to each cluster; Using the initial holiday category labels and the day of week feature (dayofweek) as input features, and the holiday clustering labels as output labels, a holiday-specific clustering category predictor is constructed to quickly determine the electricity price pattern category corresponding to the holiday to be predicted and output the holiday electricity price pattern category. Machine learning algorithms are used to construct corresponding prediction models for all non-holiday historical electricity price data and holiday historical electricity price data respectively. Specifically, for all non-holiday data (corresponding to cluster label Cluster_type = -1), a basic electricity price prediction model is trained to adapt to the electricity price prediction needs in non-holiday scenarios; for all holiday data (corresponding to cluster label Cluster_type = 0…N), a corresponding dedicated electricity price prediction model is trained for each holiday electricity price pattern category.
[0040] To obtain the date to be predicted, first determine whether it is a holiday. If it is a holiday, use a clustering category predictor to generate a holiday electricity price pattern category. Based on the holiday electricity price pattern category, call the prediction model corresponding to that holiday electricity price pattern category from all prediction models corresponding to the historical electricity price data of the holiday to predict the electricity price. If the date to be predicted is not a holiday, directly call the prediction model of the historical electricity price data of non-holidays to predict the electricity price. The final predicted electricity price value for the date to be predicted is obtained.
[0041] Example 3 Based on the holiday electricity price prediction method based on clustering and hybrid modeling described in Example 2, this example uses the real-time market electricity price of a certain regional power grid as an example. The training data covers April to September 2024, and the test data is from October 2024 (including the National Day holiday). The electricity price prediction method based on clustering and hybrid modeling described in Example 1 is used for prediction, and compared with the traditional single LightGBM benchmark model that only uses lag features. The performance evaluation results are shown in Table 2 below.
[0042] Table 2
[0043] As shown in Table 2 above, by comparing the method of this invention with the traditional single LightGBM benchmark model, the results show that the MAE (Mean Absolute Error), RMSE (Root Mean Squared Error), and MAPE (Mean Absolute Percentage Error) are obtained. The method employs three core evaluation metrics (MAE, RMSE, and MAPE) to quantify the deviation between the predicted results and the actual values. Specifically, in training and prediction using full-scale data including both holiday and non-holiday data, the MAE of this invention decreased from 53.85 to 46.50, RMSE from 82.35 to 71.00, and MAPE from 15.64% to 13.50%, with a 13.78% improvement in MAE compared to the benchmark model. In prediction using only holiday data, the MAE of this invention decreased from 50.77 to 41.00, RMSE from 82.54 to 68.00, and MAPE from 13.94% to 10.50%, with a 19.25% improvement in MAE compared to the benchmark model. In summary, the performance improvement of this invention is greater in holiday scenarios where electricity price fluctuations are more complex. It can effectively avoid the interference of a single global model in complex scenarios and accurately capture the nonlinear fluctuation pattern of holiday electricity prices.
[0044] In this embodiment, the electricity price forecast performance during the National Day holiday (October 1st to 3rd, 2024) is analyzed. The time-series curves visually compare the matching degree between the prediction results of the method of this invention, the traditional single LightGBM benchmark model, and the actual electricity prices. Figure 3 As shown, the green triangular curve corresponding to the method of this invention closely matches the fluctuation trend of the actual electricity price curve represented by the black solid line throughout the entire time period, while the orange dot curve of the benchmark model deviates more from the actual curve, indicating that the method of this invention has a significantly better ability to track the overall trend of electricity prices. During periods of sharp price fluctuations, such as peaks (around 00:00 on October 2nd and around 12:00 on October 3rd) and troughs (around 12:00 on October 1st and around 12:00 on October 2nd), the deviation between the predicted and actual values of the method of this invention is significantly smaller. This result verifies the clustering identification of holiday electricity price patterns and the prediction method combining hybrid models of this invention. Through accurate clustering of holiday electricity price patterns and dedicated model training, it can better capture the nonlinear fluctuation characteristics of electricity prices during holidays, and its prediction stability and accuracy under extreme fluctuation scenarios are significantly better than traditional single benchmark models.
[0045] Example 4 Based on the electricity price prediction method based on clustering and hybrid modeling described in Example 1, this example proposes an electricity price prediction system based on clustering and hybrid modeling, including an initial classification module, a deep clustering module, a clustering classification module, a separate hybrid model construction module, and an intelligent prediction module. The initial classification module is used to acquire historical electricity price data, classify the historical electricity price data by initial date based on public calendar rules, and generate initial date classification labels; The deep clustering module is used to filter historical electricity price data for the date to be predicted, form a daily electricity price pattern sample set based on the historical electricity price data for the date to be predicted, cluster the daily electricity price pattern sample set, and generate cluster labels for the date to be predicted. The clustering and classification module is used to construct a clustering category predictor based on the clustering label of the date to be predicted and the initial date classification label, and output the electricity price pattern category of the date to be predicted; The separate hybrid model construction module is used to construct corresponding prediction models for all historical electricity price data using machine learning algorithms. The intelligent prediction module is used to call the corresponding prediction model based on the electricity price pattern category of the date to be predicted, extract the features of the date to be predicted, and generate the predicted electricity price value.
[0046] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can be appropriately combined to form other embodiments that can be understood by those skilled in the art. The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.
Claims
1. A method for predicting electricity prices based on clustering and hybrid modeling, characterized in that, Includes the following steps: Historical electricity price data is acquired, and based on public calendar rules, the historical electricity price data is initially categorized by date, and initial date category labels are generated; Historical electricity price data for the date to be predicted is filtered out. Based on the historical electricity price data for the date to be predicted, a daily electricity price pattern sample set is formed. The daily electricity price pattern sample set is clustered to generate cluster labels for the date to be predicted. Based on the clustering labels of the dates to be predicted and the initial date classification labels, a clustering category predictor is constructed to output the electricity price pattern category for the dates to be predicted. Using machine learning algorithms, based on the clustering labels of the dates to be predicted, corresponding prediction models are built for all historical electricity price data; Based on the electricity price pattern category of the date to be predicted, the corresponding prediction model is invoked, the features of the time to be predicted are extracted, and the predicted electricity price value is generated.
2. The electricity price prediction method based on clustering and hybrid modeling according to claim 1, characterized in that, The acquisition of historical electricity price data involves initial date classification based on public calendar rules, forming initial date classification labels. Specifically, this includes: acquiring historical electricity price data and related influencing factor data, which includes timestamps, hours, days of the week, and months; cleaning the historical electricity price data and related influencing factor data, and sorting them in ascending order by timestamps; and using public calendar rules to initially classify dates after data cleaning and ascending sorting, forming initial date classification labels "holiday_type" for "weekdays," "weekends," "short holidays," and "long holidays." 3. The electricity price prediction method based on clustering and hybrid modeling according to claim 1, characterized in that, The process of filtering historical electricity price data for the dates to be predicted involves forming a daily electricity price pattern sample set based on the historical electricity price data for the dates to be predicted. Specifically, the historical electricity price data for the dates to be predicted is filtered from the historical electricity price data according to the initial date classification label. For all the historical electricity price data for the dates to be predicted, the 24-hour electricity price data for each day is taken as a daily electricity price pattern vector to form a daily electricity price pattern sample set.
4. The electricity price prediction method based on clustering and hybrid modeling according to claim 3, characterized in that, The daily electricity price pattern sample set is standardized. The K-means unsupervised clustering algorithm is used to identify the similarity of all daily electricity price pattern vectors in the standardized daily electricity price pattern sample set. The standardized daily electricity price pattern sample set is clustered to generate N typical electricity price pattern clusters. A corresponding clustering label is assigned to each typical electricity price pattern cluster. The clusters of the N typical electricity price patterns are mapped to the standardized daily electricity price pattern sample set, and the clustering label Cluster_type of the date to be predicted is output, where the clustering label Cluster_type=-1 for the date not to be predicted.
5. The electricity price prediction method based on clustering and hybrid modeling according to claim 1, characterized in that, The method involves constructing a cluster category predictor based on the clustering label of the date to be predicted and the initial date classification label, and outputting the electricity price pattern category for the date to be predicted. Specifically, a classification model is used, with the initial date classification label as the input feature and the clustering label of the date to be predicted as the input label. The classification model is trained to construct a cluster category predictor, which performs clustering and classification based on the input data and outputs the electricity price pattern category for the date to be predicted.
6. The electricity price prediction method based on clustering and hybrid modeling according to claim 1, characterized in that, Machine learning algorithms are used to construct corresponding prediction models for all historical electricity price data based on the cluster labels of the dates to be predicted. Specifically, the LightGBM algorithm is used to construct a basic prediction model for all historical electricity price data that are not to be predicted, and for the historical electricity price data of the dates to be predicted, a separate electricity price prediction model is constructed for each cluster label of the date to be predicted.
7. The electricity price prediction method based on clustering and hybrid modeling according to claim 1, characterized in that, The process involves identifying the electricity price pattern category based on the date to be predicted, calling the corresponding prediction model, extracting the time-specific features, and generating the predicted electricity price value. Specifically, based on the macro-calendar attributes of the date to be predicted, the initial date classification label based on public calendar rules, and the week number among the influencing factors of historical electricity price data, a clustering category predictor is used to perform clustering, outputting the electricity price pattern category for the date to be predicted. Based on the electricity price pattern category for the date to be predicted, the corresponding prediction model is intelligently matched from the prediction models for all dates, the time-specific features of the date to be predicted are extracted, input into the corresponding prediction model, and the predicted electricity price value for the date to be predicted is output.
8. A method for predicting electricity prices during holidays based on clustering and hybrid modeling, wherein the method for predicting electricity prices based on clustering and hybrid modeling is described in any one of claims 1 to 7, characterized in that, Includes the following steps: Historical electricity price data for holidays is selected from historical electricity price data. Based on the historical electricity price data for holidays, a daily electricity price pattern sample set is formed. The daily electricity price pattern sample set is clustered to generate holiday cluster labels. Based on holiday clustering labels and initial date classification labels, a clustering category predictor is constructed to output the holiday electricity price pattern category; Machine learning algorithms were used to construct corresponding prediction models for all historical electricity price data on non-holidays and historical electricity price data on holidays. Based on the holiday electricity price pattern category, the corresponding prediction model is called to extract the features of the holiday time and generate the predicted value of the holiday electricity price.
9. The method for predicting holiday electricity prices based on clustering and hybrid modeling according to claim 8, characterized in that, For the date to be predicted, it is determined whether it is a holiday. If it is a holiday, a clustering category predictor is used to generate a holiday electricity price pattern category. Based on the holiday electricity price pattern category, the prediction model corresponding to the holiday electricity price pattern category is called from all prediction models corresponding to the historical electricity price data of the holiday to make an electricity price prediction. If the date to be predicted is not a holiday, the prediction model of the historical electricity price data of non-holidays is directly called to make an electricity price prediction.
10. A power price forecasting system based on clustering and hybrid modeling, comprising a power price forecasting method based on clustering and hybrid modeling as described in any one of claims 1 to 7, characterized in that, It includes an initial classification module, a deep clustering module, a clustering classification module, a separate hybrid model construction module, and an intelligent prediction module; The initial classification module is used to acquire historical electricity price data, classify the historical electricity price data by initial date based on public calendar rules, and generate initial date classification labels; The deep clustering module is used to filter historical electricity price data for the date to be predicted, form a daily electricity price pattern sample set based on the historical electricity price data for the date to be predicted, cluster the daily electricity price pattern sample set, and generate cluster labels for the date to be predicted. The clustering and classification module is used to construct a clustering category predictor based on the clustering label of the date to be predicted and the initial date classification label, and output the electricity price pattern category of the date to be predicted; The separate hybrid model construction module is used to construct corresponding prediction models for all historical electricity price data using machine learning algorithms. The intelligent prediction module is used to call the corresponding prediction model based on the electricity price pattern category of the date to be predicted, extract the features of the date to be predicted, and generate the predicted electricity price value.
Citation Information
Patent Citations
Short-term electricity price prediction method based on similar day method and Adaboost model
CN113516520A
Resident daily electricity consumption prediction method and device based on dynamic clustering and time sequence fusion network, storage medium and system
CN120414503A
