A power spot day-ahead electricity price prediction method and system based on multi-model ensemble stacking and double-layer feature learning
Patent Information
- Application Number
- CN202611024261.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-10-16
AI Technical Summary
[0005]缺点一:单一模型难以兼顾不同电价区间的异质性预测需求
[0041]First, the prediction accuracy for extreme electricity price ranges is improved. This invention employs a triple design—class gradient boosting interval classification, adaptive price penalty loss, and Stacking fusion—to enable the model to achieve differentiated modeling capabilities across different electricity price ranges, significantly improving the prediction accuracy for extreme high and negative electricity price ranges.
Smart Images

Figure CN122928382A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power market transaction decision technology, specifically relating to a method and system for predicting day-ahead electricity spot prices based on multi-model ensemble Stacking and two-layer feature learning. Background Technology
[0002] Day-ahead electricity price forecasting is a core foundational element in electricity market trading decisions. Under the dual-track system of "medium- to long-term contracts + spot market," electricity retailers are required to submit electricity price quotes at various time points for the following day before the day-ahead market closes. The core basis for this is the day-ahead electricity price forecast. The accuracy of the day-ahead price forecast directly impacts subsequent real-time-day price spread forecasting, arbitrage strategy formulation, and bid coefficient optimization, serving as the fundamental input for the entire electricity spot market trading decision-making chain.
[0003] In several pilot provinces of China's electricity spot market, day-ahead electricity prices exhibit high complexity, non-stationarity, and range heterogeneity. Influenced by multiple factors such as fluctuations in renewable energy output, changes in load demand, unplanned unit outages, transmission congestion, and market participant bidding strategies, electricity prices in different provinces, seasons, and time periods show drastically different statistical characteristics. Taking a typical province as an example, day-ahead electricity prices fluctuate significantly between -100 yuan per MWh and 1,500 yuan per MWh, with deep negative prices and extremely high prices occurring at approximately 8% of the total annual time points, exhibiting a typical "peak-fat-tail" distribution pattern.
[0004] Existing day-ahead electricity price forecasting technologies have the following main drawbacks:
[0005] Disadvantage 1: A single model struggles to account for the heterogeneous forecasting needs across different electricity price ranges. Electricity market price distribution exhibits significant range heterogeneity. In normal price ranges, prices are primarily driven by supply and demand fundamentals, and tree models can effectively capture the non-linear relationship between features and prices. In extremely high price ranges, prices are often driven by unforeseen events, making it difficult for tree models to learn effectively. In negative price ranges, price behavior is dominated by the pressure of renewable energy consumption, a combination of driving factors completely different from that in positive price ranges. A single model attempts to fit the price behavior across all ranges using a uniform functional form, resulting in a significantly larger prediction error in extreme ranges compared to normal ranges.
[0006] Disadvantage 2: The training loss function lacks a differentiated penalty mechanism for prediction errors during high-price periods. In the electricity spot market, the impact of price prediction errors during high-price periods on downstream decision-making is far greater than during low-price periods. Most existing model training techniques use mean squared error or mean absolute error as the loss function, imposing the same penalty on prediction errors for all samples, without considering the differences in error costs across different price ranges.
[0007] Disadvantage 3: Multi-model fusion uses fixed weights and lacks dynamic adaptability. Most existing multi-model fusion technologies use fixed weights or static meta-models, which do not take into account the dynamic changes in the relative advantages of each model under different market conditions. Fixed fusion weights cannot adapt to the dynamic switching of model advantages.
[0008] Disadvantage 4: Feature loss and distribution offset issues in holiday advance forecasting scenarios. In holiday advance forecasting scenarios, feature data such as load forecasting and new energy forecasting for the holiday day have not yet been released or are in an abnormal state. Directly inputting missing features into the model will lead to serious prediction bias. Most existing technologies have not designed special processing mechanisms for this special scenario.
[0009] Disadvantage 5: Long Short-Term Memory (LSTM) network temporal models lack multi-dimensional attention mechanisms, making it difficult to effectively focus on key information. When using existing LTM network models for electricity price prediction, they typically stack LTM network layers plus fully connected layers directly without applying attention mechanisms to the feature dimension and time dimension separately, thus limiting the expressive power of temporal features. Summary of the Invention
[0010] To address the aforementioned shortcomings of existing technologies, this invention provides a method and system for predicting day-ahead electricity spot prices based on multi-model ensemble stacking and two-layer feature learning.
[0011] This invention provides a method for predicting day-ahead electricity spot prices based on multi-model ensemble stacking and two-layer feature learning, comprising the following steps:
[0012] Data preparation steps: Obtain historical market clearing data and calendar data, and use a three-level progressive filling strategy to process missing values in the prediction set, which involves filling with recent simultaneous points, filling with the average value of multiple days, and feature removal in sequence.
[0013] Specifically, historical market clearing data includes fields such as power generation output, load demand, tie-line power, and historical electricity prices. Calendar data includes date, day of the week, month, and holiday identifiers. The training data window is dynamically configured by province, with a typical value ranging from 30 to 180 days.
[0014] Holiday feature compensation steps: Determine whether it is in advance prediction mode. Advance prediction mode is a mode that predicts the electricity price for future holidays one working day before the prediction date. Based on the calendar data, determine whether the prediction date is a holiday or a weekend. If it is in advance prediction mode and the prediction date is a holiday or a weekend, then a differentiated feature compensation strategy is executed according to the holiday type; otherwise, no feature compensation processing is performed.
[0015] The compensation strategy includes: replacing statutory holidays with feature data from the last working day before the holiday at the same time, i.e. A typical weekend is constructed using the moving average of the characteristics of multiple working days prior to the holiday at the same time. The mechanism's statutory holiday retrospective substitution strategy utilizes the continuity of market supply and demand structure between the last working day before the holiday and the holiday itself, avoiding the distribution shift caused by directly using working day characteristics to predict holidays; the ordinary weekend moving average construction strategy avoids the bias caused by directly using working day characteristics to predict weekends, while preserving the differences in electricity consumption patterns between weekends and working days.
[0016] Feature engineering steps: Construct the first feature set for the lightweight gradient boosting master model, the second feature set for the long short-term memory network temporal model, and the third feature set for the extreme gradient boosting auxiliary model in parallel.
[0017] The first feature set includes business supply and demand features, multi-window moving average features, and fluctuation features. Business supply and demand features include core supply and demand indicators such as net load, load factor, and the proportion of renewable energy. The multi-window moving average feature calculates a moving average of the core indicators over one to eight days at the same time. Fluctuation features include the seven-day rolling standard deviation and range. Additionally, it includes lag features, peak-to-valley segmentation features, and time features. By constructing multi-dimensional business supply and demand features and fluctuation features, this feature set enables the lightweight gradient boosting master model to effectively capture the nonlinear relationship between features and electricity prices.
[0018] The second feature set includes time-series periodic coding features and composite business features. The time-series periodic coding features include intraday point-in-time sine-cosine coding and periodic sine-cosine coding. The composite business features include the renewable energy pressure index, wind-solar ratio, net load gap and its signed logarithmic transformation, renewable energy change rate, rolling standard deviation, etc. This feature set, through time-series periodic coding and composite business features, enables the Long Short-Term Memory (LSTM) network time-series model to effectively capture the time dependence of electricity prices.
[0019] The third feature set includes thermal power forecast features constructed based on the physical constraints of the power system. The thermal power forecast values are based on the physical constraints of the power system clearing balance, meaning the thermal power forecast value equals the total load demand minus the total non-thermal power supply. It also includes electricity price lag features from one to two weeks prior. This feature set, constructed based on physical constraints, enables the extreme gradient boosting auxiliary model to provide forecast results from a perspective different from the lightweight gradient boosting master model.
[0020] The multi-model parallel prediction steps are as follows: The first feature set is input into a trained lightweight gradient boosting master model to obtain a first prediction result; the second feature set is input into a trained long short-term memory network time series model to obtain a second prediction result; and the third feature set is input into a trained extreme gradient boosting auxiliary model to obtain a third prediction result. Specifically, the lightweight gradient boosting master model is used to capture the nonlinear relationship between features and electricity price, the long short-term memory network time series model is used to capture the time dependency of electricity price, and the extreme gradient boosting auxiliary model is used to provide prediction results from a different perspective than the lightweight gradient boosting master model.
[0021] Stacking fusion steps: When the lightweight gradient boosting master model, the long short-term memory network time series model, and the extreme gradient boosting auxiliary model are all enabled and the prediction results are complete, a linear regression meta-model is obtained, and the first prediction result, the second prediction result, and the third prediction result are input into the linear regression meta-model for prediction to obtain the final fused predicted electricity price; if any condition is not met, the first prediction result is used as the final fused predicted electricity price.
[0022] The meta-model's input features include the prediction results of the three models, high-price consistency count features, and original business features. The meta-model is updated monthly, retrained each month using the historical prediction results of the three models from the previous month and the corresponding actual electricity prices. This step integrates the complementary advantages of heterogeneous models through a stacking fusion strategy, enabling a more comprehensive capture of nonlinear patterns and multi-scale temporal dependencies in the electricity price sequence; monthly rolling updates allow the fusion weights to automatically adjust according to market conditions; and an automatic degradation fallback mechanism ensures system robustness.
[0023] Post-processing steps: Based on the preset price floor configurations for each province, the final fused predicted electricity price is trimmed and output, i.e. .
[0024] Preferably, the long short-term memory network temporal model adopts a dual-attention network architecture, including:
[0025] The feature attention module employs a Sigmoid gating mechanism to independently calculate attention weights for each dimension of the second feature set input to the Long Short-Term Memory network temporal model. The attention weights are then element-wise weighted with the second feature set. This module enables the model to automatically focus on feature dimensions that are more important for electricity price prediction and suppress the influence of redundant features.
[0026] A bidirectional long short-term memory network layer is used to model the forward and backward temporal dependencies of the weighted features and output a sequence of hidden states. This layer simultaneously captures both forward temporal dependencies (from past to future) and backward temporal dependencies (from future to past), improving the temporal modeling capability.
[0027] The temporal attention module receives the hidden state sequence, calculates the attention weights for each time step using the Tanh activation function and Softmax normalization, and then performs a weighted summation of the hidden state sequence based on these attention weights to obtain a context vector. This module enables the model to automatically focus on the time steps that are more critical to the current prediction.
[0028] The residual connection module directly connects the original features from the last time step of the second feature set to the fully connected output layer via a linear mapping. This module alleviates the vanishing gradient problem in deep networks while preserving the original input information.
[0029] Preferably, the long short-term memory network time series model employs an adaptive price penalty loss function during training. The adaptive price penalty loss function assigns differentiated penalty factors based on the range of the actual electricity price, thereby imposing higher weights on the prediction error in the high electricity price range.
[0030] The adaptive price penalty loss function is expressed as follows:
[0031] ;
[0032] in, This represents the true value of the electricity price. For predicted values, The total number of samples, For piecewise step functions:
[0033] ;
[0034] This loss function assigns a higher penalty weight to high-price periods, making the model training process focus more on the prediction accuracy during high-price periods, thereby improving the impact of prediction errors during high-price periods on downstream decision-making.
[0035] Preferably, the feature engineering step further includes: classifying the electricity price intervals using a trained categorical gradient boosting classification model to output interval prediction labels; and concatenating the interval prediction labels as categorical features into the first feature set for training and prediction of the lightweight gradient boosting master model. This mechanism decomposes continuous electricity price prediction into two stages: "interval identification + precise regression," providing explicit prior information on electricity price intervals to the lightweight gradient boosting master model, enabling the model to employ differentiated tree splitting strategies in different electricity price intervals.
[0036] Preferably, the three-level progressive filling strategy includes: First level, for missing values in the prediction set, filling them with values from the training set at the same time on the most recent day, i.e. The second level involves filling missing values after the first level of filling with the average of data from the same point 30 days prior to the forecast date. The third level involves removing any feature columns that remain empty after the second level of filling. If these columns are empty at all points in time within a consecutive 30-day period, the entire column is removed. After removal, the first, second, and third feature sets are all constructed based on the remaining feature columns. This mechanism ensures the integrity of the prediction set features through a three-level progressive processing, while preventing low-quality features from interfering with the model through feature removal.
[0037] Preferably, the linear regression meta-model is updated monthly, specifically including: monthly, retraining the linear regression meta-model using the historical prediction results and corresponding actual electricity prices of the previous month's lightweight gradient boosting master model, the long short-term memory network time series model, and the extreme gradient boosting auxiliary model; naming and saving the trained linear regression meta-model by province and month; loading the trained linear regression meta-model for prediction during daily forecasts, and automatically loading the parameters of the latest month's linear regression meta-model for prediction during cross-month forecasts; if the linear regression meta-model for the corresponding month does not exist, it is automatically retrained using historical data. This mechanism enables the fusion weights to automatically adjust with changes in market conditions, achieving dynamic adaptation of model advantages.
[0038] This invention also provides a day-ahead electricity price forecasting system based on multi-model ensemble Stacking and two-layer feature learning, comprising: a data preparation module, a holiday feature compensation module, a feature engineering module, a multi-model parallel forecasting module, a Stacking fusion module, and a post-processing module. The functions of each module correspond one-to-one with the steps described above.
[0039] Preferably, the system adopts a province-based plug-in architecture, including: a general prediction engine base class, which encapsulates the general processes of data preprocessing, model training and prediction invocation, and splitting the training set and prediction set; and province subclasses, which inherit from the general prediction engine base class and override the feature engineering methods to achieve differentiated business adaptation for different provinces; the main process of the system is automatically routed to the corresponding province subclass for execution through a preset province configuration mapping relationship. This architecture allows for quick integration of new provinces simply by inheriting the base class and implementing feature engineering, exhibiting good scalability.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] First, the prediction accuracy for extreme electricity price ranges is improved. This invention employs a triple design—class gradient boosting interval classification, adaptive price penalty loss, and Stacking fusion—to enable the model to achieve differentiated modeling capabilities across different electricity price ranges, significantly improving the prediction accuracy for extreme high and negative electricity price ranges.
[0042] Second, the downstream impact of prediction errors during high-price periods is reduced. The adaptive price penalty loss function assigns higher weight to high-price periods during the long short-term memory network training phase, making the prediction bias during high-price periods more important to the model. This can be passed on to improve the judgment of downstream price spread direction and the effectiveness of bidding strategies.
[0043] Third, multi-model stacking fusion outperforms single-model and fixed-weight fusion in terms of accuracy and stability. Stacking fusion uses a monthly rolling linear meta-model and high-price consistency auxiliary features, which can adjust the fusion weights according to changes in market conditions, making it more robust than the fixed-weight scheme in months with high volatility.
[0044] Fourth, the robustness of scenarios involving advance prediction of holidays is improved. A three-level compensation mechanism, which uses retrospective substitution for statutory holidays and the moving average of ordinary weekends, can avoid input drift caused by missing or abnormal key features on the target day.
[0045] Fifth, the dual-attention long short-term memory network architecture enhances temporal modeling capabilities. The feature attention module and the temporal attention module weight the input from the feature dimension and the temporal dimension, respectively, and the residual connections retain the most recent input information, improving the model's ability to express key time points and key features.
[0046] Sixth, the system framework is highly scalable. The plug-in architecture for provinces allows adding a province to be adapted in just two steps: inheriting the base class and implementing feature engineering, which has good engineering practicality. Attached Figure Description
[0047] Figure 1 This is an overall flowchart of the day-ahead electricity price prediction method for electricity spot market based on multi-model ensemble Stacking and two-layer feature learning, as described in this invention.
[0048] Figure 2 This is a module framework diagram of the day-ahead electricity price forecasting system for electricity spot market based on multi-model ensemble Stacking and two-layer feature learning, as described in this invention. Detailed Implementation
[0049] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. Figure 1As shown, the electricity spot day-ahead price prediction method based on multi-model ensemble stacking and two-layer feature learning provided by this invention includes the following seven steps in its overall process. The correspondence between each step and the embodiments is shown in Table 1 below:
[0050] Table 1 Correspondence between Steps and Examples
[0051]
[0052] Combined Figure 2 As shown, the day-ahead electricity price forecasting system based on multi-model integration Stacking and two-layer feature learning provided by this invention includes a data preparation module, a holiday feature compensation module, a feature engineering module, a multi-model parallel forecasting module, a Stacking fusion module, and a post-processing module. The specific operation of the data preparation module is described in Example 1; the specific operation of the holiday feature compensation module is described in Example 2; the specific operation of the feature engineering module is described in Example 3; the specific operation of the multi-model parallel forecasting module is described in Example 4; the specific operation of the Stacking fusion module is described in Example 5; and the specific operation of the post-processing module is described in Example 6. The province-specific plug-in architecture adopted by the system is described in Example 7.
[0053] Example 1: Data Preparation and Missing Value Imputation
[0054] Step S101: Data Preparation. Retrieve historical market clearing data from the full feature wide table in the database, using data windows. This includes fields such as power generation output, load demand, tie-line power, and historical electricity prices. The data window is dynamically configured by province, typically ranging from 30 to 180 days. Simultaneously acquire calendar data, including date, day of the week, month, and holiday identifiers.
[0055] Step S102: Three-level imputation of missing values. Missing values in the prediction set are handled using a three-level mechanism.
[0056] Level 1 – Nearest Date Simultaneous Point Filling: For feature columns with null values in the prediction set, fill them with values from the same column at the same time point of the most recent day (i.e., the latest date) in the training set.
[0057] ;
[0058] in Indicates the predicted date. Indicates a point in time. Represents the characteristic column, The maximum date in the training set is used. This strategy is based on the short-term continuity of power system states, with the most recent day's data best reflecting the latest system state. Therefore, by utilizing the short-term continuity of power system states and filling the data with data from the most recent day at the same time, the most up-to-date system state information can be preserved to the greatest extent possible.
[0059] Level 2 – 30-Day Simultaneous Point Mean Filling: For features that remain null after Level 1 filling, fill using the mean of the last 30 days simultaneous points.
[0060] ;
[0061] in To predict the set of dates for the next thirty days, This indicates the number of dates in the set. This provides a robust, filled baseline by smoothing out random fluctuations using the average of multiple days.
[0062] The third level – feature removal: For feature columns that are still empty after the second level of filling, if they are empty at all points in time within a consecutive 30-day period, then the entire feature column is removed. This prevents low-quality features from interfering with the model's prediction accuracy.
[0063] Missing values in the training set are uniformly filled using a second-level mechanism (average of values at the same time over the past 30 days), and rows containing missing values are automatically removed during training. After removal, the first feature set, the second feature set, and the third feature set are all constructed based on the remaining feature columns after removal.
[0064] Example 2: Holiday Feature Compensation
[0065] Step S103: Holiday Feature Compensation. Determine whether it is an advance prediction mode, which is a mode that predicts the electricity price for future holidays one working day before the prediction date, and determine whether the prediction date is a holiday or a weekend based on the calendar data.
[0066] If the forecast mode is in progress and the forecast date falls on a statutory holiday, the "nearest working day retrospective substitution" strategy will be adopted:
[0067] ;
[0068] in Indicates a point in time. Represents the characteristic column, This represents the values of the same feature column at the same time on the last working day before the holiday. In other words, it replaces all holiday features with the complete feature data of the last working day before the holiday. This ensures continuity in the market supply and demand structure between the last working day before the holiday and the holiday (new energy output, interconnection line plans, unit combinations, etc., have inertia), and the feature data for that day is complete and available, effectively avoiding distribution shifts caused by directly using working day features to predict holidays.
[0069] If the forecast is in advance and the forecast date is a regular weekend, the "moving average construction" strategy is adopted:
[0070] ;
[0071] in Indicates the last one before the holiday One working day Indicates the last one before the holiday The weekend characteristics are constructed by using the moving average of the data from the same point on each workday during the week. This avoids the bias that can occur when directly using weekday characteristics to predict the weekend (such as overestimating industrial load) while preserving the differences in electricity consumption patterns between weekends and weekdays.
[0072] If it is not a pre-prediction mode, the existing feature data is used directly without feature compensation processing.
[0073] Example 3: Feature Engineering
[0074] Step S104: Feature Engineering. Perform lightweight gradient boosting feature engineering, long short-term memory network temporal feature engineering, extreme gradient boosting feature engineering, and categorical gradient boosting interval classification feature engineering in parallel.
[0075] 1. Lightweight Gradient Booster Feature Engineering
[0076] Construct the first feature set for the lightweight gradient boosting machine master model, including the following dimensions:
[0077] (1) Business supply and demand characteristics:
[0078] ;
[0079]
[0080] ;
[0081] ;
[0082] ;
[0083] Load factor is an effective proxy variable for supply and demand tension. The higher the load factor, the tighter the supply and demand. Based on the classic theory of power system economics, it can effectively characterize the ratio between dispatchable generation resources and actual load.
[0084] (2) Multi-window moving average characteristics: For core indicators such as the electricity delivered by generator units at t-1, the electricity delivered by market users at t-1, thermal power at t-1, wind power at t-1, photovoltaic power at t-1, and independent energy storage at t-1, the moving average of the same point from one to eight days is calculated. In this way, the demand trend of multiple cycles from short-term (one day) to medium-term (eight days) is covered.
[0085] (3) First-order difference characteristics: For key variables such as provincial load, test units, photovoltaic, local power plants, non-market nuclear power, self-owned units, tie-line load, wind power, and pumped storage planned power generation, calculate the first-order difference at the same time on adjacent days:
[0086] ;
[0087] in Indicates date Time point Feature columns The numerical values are thus eliminated. By removing the long-term trends of each variable and highlighting the recent direction of change, the model can identify short-term market reversal signals.
[0088] (4) Fluctuation characteristics: For core variables such as net load and provincial load, calculate the seven-day rolling standard deviation and range:
[0089] ;
[0090] ;
[0091] in This represents the average value at the same time each day for the previous seven days. This characterizes the near-term uncertainty of each variable; periods of high volatility often correspond to high electricity price risks.
[0092] (5) Lag characteristics: The first-phase lag characteristics of net load construction: .
[0093] (6) Peak-to-valley segmentation characteristics: Based on the quantiles of the historical net load point-to-point distribution average, the peak, flat, and valley segments are automatically divided:
[0094] ;
[0095] in For time point The rank percentile of the historical net load average at all points in time. and These are the 20th and 80th percentiles, respectively. This data-driven approach, rather than a fixed time period division, allows for adaptation to the peak and valley characteristics of each province.
[0096] (7) Time features: A complete time feature system is constructed, including month, week (number of days of the week), day (date), hour, season, weekday / weekend identifier, beginning of month / end of month identifier, pre-holiday / post-holiday identifier, week number, and net load positive / negative identifier. All categorical features (with fewer than five unique values and no null values) are automatically identified as categorical variables by a lightweight gradient booster and processed using the Fisher optimal splitting algorithm.
[0097] 2. Category gradient enhancement interval feature overlay;
[0098] A trained class gradient boosting classification model is used to classify electricity price ranges and output range prediction labels. The class gradient boosting classification model is a classification model based on the class gradient boosting algorithm.
[0099] Step 1: Price Range Division. Based on the characteristics of electricity price distribution, the continuous value is discretized into several intervals, and the interval boundaries are dynamically adjusted according to the electricity price distribution characteristics of each province.
[0100] Step 2: Classification model training and prediction using category gradient boosting. A lightweight classification model is trained using a category gradient boosting classifier, employing all non-target columns from the training set as features, and performing classification inference on the prediction set. The automatic processing (ordered encoding) of category features by category gradient boosting gives it good performance in mixed data type scenarios.
[0101] Step 3: The classification results are used as category features for the lightweight gradient booster. The predicted price interval numbers output by the category gradient booster are added to the feature set of the lightweight gradient booster through outer joins, serving as a category feature named "Predicted Price Interval". During training, the lightweight gradient booster automatically recognizes this feature as a category variable and combines it with other category features during tree splitting.
[0102] In this way, continuous electricity price forecasting is decomposed into two stages: "interval identification + precise regression". This provides explicit prior information on electricity price intervals for the lightweight gradient booster master model, enabling the model to adopt differentiated tree splitting strategies in different electricity price intervals, thereby enhancing the modeling ability of the heterogeneity of electricity price intervals.
[0103] 3. Temporal feature engineering of Long Short-Term Memory (LSTM) networks;
[0104] Construct a second feature set for the temporal model of Long Short-Term Memory (LSTM) networks, including:
[0105] (1) Intraday time point periodic coding:
[0106] ;
[0107] ;
[0108] in This indicates the sequence number of that point in the day (starting from zero). This represents the total number of transactions per day, configured according to the province's transaction rules (typical values are 24, 48, or 96).
[0109] (2) Periodic encoding:
[0110] ;
[0111] ;
[0112] in It indicates the day of the week (zero for Monday, six for Sunday). Sine-cosine encoding avoids the model being misled by numerical values from zero to twenty-three hours and from zero to six weeks.
[0113] (3) Peak time period marking:
[0114] ;
[0115] ;
[0116] in This is an indicator function; it takes the value of one when the condition within the parentheses is true, and zero otherwise.
[0117] (4) Business composite characteristics:
[0118] ;
[0119] ;
[0120] ;
[0121] ;
[0122] in The sign function is used. The sign logarithmic transformation decomposes the net load gap into direction (sign) and magnitude (logarithm), avoiding large fluctuations in the original value from affecting the stability of model training.
[0123] (5) Higher-order temporal characteristics:
[0124] ;
[0125] ;
[0126] in It is a very small positive number (such as 10 to the power of negative 6) to prevent the denominator from being zero; the size of the sliding window is automatically calculated according to the granularity of the time point of the province (such as in the high granularity, the window size is four corresponding to one hour).
[0127] (6) Holidays and polynomial features: Construct polynomial features such as holiday identifiers, weekend identifiers, and point-in-time square and cube features. In this way, the polynomial features help the model capture the nonlinear curve shape of intraday electricity prices.
[0128] 4. Extreme Gradient Boosting Feature Engineering
[0129] Construct a third feature set for the extreme gradient boosting auxiliary model, including:
[0130] (1) Core business feature mapping:
[0131] ;
[0132] ;
[0133]
[0134] ;
[0135] ;
[0136] The predicted value of thermal power represents the net load that needs to be borne by market-based thermal power units and is a core indicator of supply and demand tension. Thus, based on the physical constraint of "power system clearing balance", the extreme gradient boosting auxiliary model can provide prediction results from a different perspective than the lightweight gradient boosting master model.
[0137] (2) Long-term lag characteristics: Constructing the electricity price lag characteristics from one to two weeks ago:
[0138] ;
[0139] Capturing cyclical electricity pricing patterns is especially important for markets with strong cyclicality.
[0140] Example 4: Parallel Prediction Using Multiple Models
[0141] Step S105: Parallel prediction using multiple models. The fused feature set output from feature engineering is input into the lightweight gradient booster main model, the extreme gradient booster auxiliary model, and the long short-term memory network time series model for parallel prediction.
[0142] 1. Lightweight Gradient Boosting Machine Master Model
[0143] The lightweight gradient booster is the main prediction model in this invention, responsible for capturing the nonlinear relationship between features and electricity prices. The training process is as follows:
[0144] (1) Data preprocessing: Perform categorical variable type conversion, numerical standardization (configured independently for each province), and feature column rearrangement in sequence.
[0145] (2) Training and prediction: Split the training set (date less than the prediction date) and the prediction set (date equal to the prediction date) by date. Train the lightweight gradient booster regression model, using the default preset hyperparameters; in implementations that require automatic optimization, Bayesian hyperparameter tuning can be enabled, and the search space covers key parameters such as the number of trees, learning rate, number of leaf nodes, and maximum depth.
[0146] (3) Category feature processing: Automatic identification (unique values less than five and no null values) or manual specification of a list of category features, including time point, month, week number, season, hour, workday, hour order, net load identifier, peak-valley classification, etc. The lightweight gradient booster uses Fisher's optimal segmentation algorithm for category features, and treats the level of the category variable as an ordered variable for segmentation after sorting it according to the target mean.
[0147] 2. Extreme Gradient Boosting Auxiliary Model
[0148] Extreme gradient boosting serves as an auxiliary model, providing prediction results from a perspective different from that of the lightweight gradient boosting machine. The training process is as follows:
[0149] (1) Data window: Use data from about ninety days before the forecast date as the training window, or configure it to sixty to one hundred and twenty days by province, which complements the province training window of the lightweight gradient booster.
[0150] (2) Model configuration: Extreme gradient boosting regressor is adopted, and class feature support is enabled. Hyperparameter search is performed through temporal cross-validation, and the search range covers the number of trees (100 to 500), learning rate (0.005 to 0.1), maximum depth (3 to 9), subsampling rate (0.6 to 1.0), column sampling rate (0.5 to 0.8), etc.
[0151] (3) Prediction output: Map the prediction results back to date and time format for subsequent Stacking fusion.
[0152] 3. Temporal model of Long Short-Term Memory network and dual attention architecture;
[0153] The Long Short-Term Memory (LSTM) network temporal model is responsible for capturing the time dependence of electricity prices. The improved LTM network designed in this invention comprises the following components from input to output:
[0154] Input processing layer: Input layer normalization is layer normalization, which normalizes the input features to stabilize the training distribution; Input dropout regularization is input dropout regularization to prevent overfitting; Input projection is a linear mapping that projects the input features to a higher-dimensional hidden space, including linear layers, layer normalization, activation functions, and dropout regularization.
[0155] Feature Attention Module: Employs a Sigmoid gating mechanism to independently compute attention weights for each dimension of the second feature set input to the Long Short-Term Memory network temporal model.
[0156] ;
[0157] Attention weights (gating values between zero and one) are independently calculated for each feature dimension in the latent space, enabling the model to automatically focus on features that are more important for electricity price prediction and suppress the influence of redundant features.
[0158] Bidirectional Long Short-Term Memory Network Layer: The bidirectional long short-term memory network is used to simultaneously capture forward temporal dependencies (from past to future) and backward temporal dependencies (from future to past). The output dimension is twice the dimension of the hidden layer (forward and backward concatenation).
[0159] The temporal attention module receives the hidden state sequence, calculates the attention weights for each time step using the Tanh activation function and Softmax normalization, and performs a weighted summation of the hidden state sequence based on these attention weights to obtain a context vector. This module enables the model to automatically focus on time steps that are more critical to the current prediction (such as recent time points rather than distant time points).
[0160] The residual connection module directly connects the original features from the last time step of the second feature set to the fully connected output layer via a linear mapping, alleviating the gradient vanishing problem in deep networks while preserving the original input information. The mathematical form of the residual connection is:
[0161] ;
[0162] in This represents the original features of the last time step in the input sequence, which are added to the output of the backbone network after linear mapping, and then processed by layer normalization and discard regularization in sequence.
[0163] Fully connected output layer: The stacked structure gradually maps the hidden dimensions to single-valued outputs, including linear layers, layer normalization, activation functions, dropout regularization, and finally linear layers.
[0164] Training configuration: The default sequence length is 24 (can be adjusted to 48, etc., depending on the province and time granularity), the default hidden layer dimension is 128, the default number of Long Short-Term Memory (LSTM) network layers is one (can be configured to multiple layers), and the default dropout rate is 0.2%. The optimizer uses an adaptive optimizer with weight decay, the learning rate uses a periodic learning rate scheduling strategy, and the early stopping strategy stops training if the validation set loss does not decrease for several consecutive rounds.
[0165] 4. Adaptive price penalty loss function;
[0166] The Long Short-Term Memory (LSTM) network time-series model employs an adaptive price-penalized loss function during training. This function assigns differentiated penalty factors based on the actual electricity price range, thus imposing higher weights on prediction errors in high-price ranges.
[0167] ;
[0168] ;
[0169] in This is the actual electricity price (unit: yuan per megawatt-hour). Forecast value (unit: yuan per megawatt-hour). The total number of samples, It is a piecewise step function, whose input is the actual electricity price. The output is the penalty factor corresponding to that interval.
[0170] The loss function reduces the false alarm cost of predicting a price of 600 yuan per megawatt-hour as 400 yuan per megawatt-hour (an error of 200 yuan) to eight times the error of the normal range (100 yuan ± 50 yuan per megawatt-hour), making the model training process more focused on the prediction accuracy during high-price periods. The penalty factor configuration and range boundaries can be flexibly adjusted through parameters.
[0171] Three-level hierarchy of adaptive price penalty loss function
[0172] It should be noted that the aforementioned Adaptive Price Penalty Loss function is the most refined solution provided by this invention. In addition, this invention also provides two other levels of loss functions as optional implementations, forming a three-level progressive price penalty loss function system:
[0173] Level 1: Weighted Mean Squared Error Loss Function (WeightedMSELoss). The simplest weighting scheme assigns fixed weights to different price ranges. Specifically, the weight is 10 when the electricity price is in the range of [0, 200] yuan / MWh, 20 when the electricity price is greater than 200 yuan / MWh or less than 0 yuan / MWh, and 5 in all other cases. The loss function is:
[0174] Level Two: High Price Penalty Loss. This focuses on high-price periods, imposing an additional penalty on samples where the predicted or actual value exceeds a threshold. The penalty factor is 3.0 when the maximum predicted or actual value exceeds 400 yuan / MWh, and 1.0 otherwise. The loss function is:
[0175] Level 3: Adaptive Price Penalty Loss, which is the most refined scheme mentioned above. It designs differentiated penalty factors (1.0 / 1.5 / 3.0 / 8.0) based on the business sensitivity of different price ranges to prediction errors.
[0176] In practical applications, the three-tiered system can be flexibly selected based on computational resources and accuracy requirements. In engineering implementations, the `loss_function` parameter is used for configuration switching; the third-tier adaptive interval penalty loss function is used by default.
[0177] Example 5: Stacking Fusion
[0178] Step S106: Stacking fusion determination and execution.
[0179] Fusion triggering conditions: Stacking fusion is triggered only when the following three conditions are met simultaneously: First, the three models, Lightweight Gradient Boosting, Extreme Gradient Boosting, and Long Short-Term Memory Network, are enabled at the same time; Second, the prediction result columns of the three models are complete and without gaps; Third, the Extreme Gradient Boosting and Long Short-Term Memory Network models run without throwing any abnormalities.
[0180] If any condition is not met, the system automatically downgrades to a lightweight gradient booster single-model prediction, using the first prediction result as the final fused predicted electricity price. This automatic downgrade fallback mechanism ensures the system can output prediction results under any circumstances, guaranteeing system robustness.
[0181] Meta-model Implementation: The meta-model employs linear regression. The input features of the meta-model include: First, the prediction results of the three models; second, the high-price consistency count feature—the number of predictions from the three models exceeding a threshold, quantifying the consistency of the three models regarding high prices; and third, the original business features—key features for the day read from the full feature wide table.
[0182] Meta-model training: Training is performed on a monthly rolling basis. Each month, the linear regression meta-model is retrained using the historical prediction results and corresponding actual electricity prices of the previous month's lightweight gradient boosting master model, the long short-term memory network time-series model, and the extreme gradient boosting auxiliary model. Min-max normalization is applied to all features to eliminate dimensional differences.
[0183] Automatic meta-model loading mechanism: Trained models are saved in PKL format, named by province and month. Daily forecasts are performed using the pre-trained linear regression meta-model, and cross-month forecasts automatically load the parameters of the latest month's linear regression meta-model. If the corresponding month's linear regression meta-model does not exist, it is automatically retrained using historical data.
[0184] The coefficients of the linear regression meta-model are essentially the fusion weights of the various models. Since the meta-model is updated monthly, the fusion weights can automatically adjust with market conditions—in the spring when renewable energy fluctuates wildly, the weight of the Long Short-Term Memory Network time series model may automatically increase; in the winter when the supply and demand structure is stable, the weight of the Lightweight Gradient Boosting Machine Tree model may automatically increase; and in months when extreme high electricity prices occur frequently, the contribution of the high-price consistency counting feature may be enhanced.
[0185] Example 6: Post-processing and Output
[0186] Step S107: Price Lower Bound Clipping and Result Output. Clip all model prediction results according to the price lower bound configured for each province:
[0187] ;
[0188] in The final output is the predicted electricity price. To predict electricity prices using the model, This is the price floor allocated to the corresponding province. The price floor for each province is allocated differently according to market rules, with a typical range of -200 to 40 yuan per megawatt-hour.
[0189] Output files: Output to the province subdirectory under the specified directory. The files are named by date and contain the following fields: date, time, day-ahead electricity price (actual value), electricity price predicted by each model, and final fused predicted electricity price.
[0190] Database write-in (optional): Write the daily forecast details table (prediction results of each model plus province identifier) and the daily forecast summary table (final merged forecast electricity price plus province identifier) into the database.
[0191] Example 7: Province-based plug-in architecture
[0192] This invention adopts an object-oriented province plug-in architecture, which supports differentiated adaptation for multiple provinces.
[0193] The general prediction engine base class encapsulates the following general logic: column name mapping and date type conversion, training set / prediction set splitting and multi-level missing value imputation, categorical variable identification and numerical standardization, multi-model training and prediction process, fusion model training and inference, and auxiliary classification feature overlay, etc.
[0194] Each provincial subclass inherits the general prediction engine base class and rewrites the feature engineering method to achieve differentiated business adaptation, including but not limited to: different data granularity (high time point granularity, medium time point granularity, standard time point granularity), different training window lengths, different feature preprocessing strategies (standardization methods, relevance filtering thresholds, etc.), and different enhancement feature switches (such as price range classification features, holiday compensation strategies, etc.).
[0195] The system's main workflow automatically routes to the corresponding province subclass for execution based on a pre-defined province configuration mapping. Adding a new province simply requires inheriting the base class and implementing the feature engineering methods for rapid integration; the entire integration cycle can be completed within a few working days. This plug-in architecture achieves a highly cohesive and loosely coupled system design, significantly improving the system's scalability and maintenance efficiency.
[0196] Example 8: Experimental Verification
[0197] Based on the actual operating data of a certain electricity sales company in the Shandong electricity spot market, six months of historical data from July to December 2025 were selected as the experimental sample. The Shandong market adopts a clearing mechanism of 96 points per day (15-minute intervals). The experiment uses a rolling window backtesting method: with each day as the prediction node, the model is trained using historical data before that day to predict the 96-point day-ahead electricity price for the next day.
[0198] The comparison methods include: persistent model (using yesterday's electricity price at the same time as today's predicted value), autoregressive integral moving average model (fitting an autoregressive moving average model point by point), single-model long short-term memory network (using only long short-term memory network for single-model prediction), and the method of this invention (lightweight gradient booster plus extreme gradient booster plus long short-term memory network plus stacking fusion).
[0199] The evaluation indicators used are mean absolute error, root mean square error, and coefficient of determination.
[0200] The overall experimental results are shown in Table 2 below:
[0201] Table 2 Overall Experimental Results
[0202]
[0203] The overall experimental results show that the method of this invention significantly outperforms the comparative methods in terms of mean absolute error, root mean square error, and coefficient of determination. Compared with the persistent model, the mean absolute error is reduced by 49.1%; compared with the autoregressive integral moving average model, the mean absolute error is reduced by 36.6%; and compared with the single-model long short-term memory network, the mean absolute error is reduced by 23.5%. This verifies the effectiveness of the multi-model stacking fusion strategy—by integrating the complementary advantages of heterogeneous models, it can more comprehensively capture the nonlinear patterns and multi-scale temporal dependencies in electricity price series.
[0204] The comparison of monthly forecast accuracy is shown in Table 3 below:
[0205] Table 3 Comparison of Monthly Forecast Accuracy
[0206]
[0207] From a monthly comparison, the method of this invention remained optimal in all months, and the prediction performance fluctuated little across different months (the mean absolute error standard deviation was only 1.56), demonstrating good robustness. In August, due to the peak summer air conditioning load and large fluctuations in photovoltaic output, the prediction errors of all methods increased, but the relative advantage of the method of this invention was more obvious in the extreme month (the mean absolute error in August was only 50.5% of that of the persistent model).
[0208] While the introduction of the Stacking fusion layer adds approximately 28 seconds of training time, it results in a significant improvement in accuracy (23.5% higher than a single-model Long Short-Term Memory network), with prediction time comparable to that of a single model (milliseconds), fully meeting the time requirements for current market reporting. In engineering deployment, training can be automatically triggered after the market closes each day, with predictions completed within seconds, without affecting the reporting process.
[0209] Based on the above experimental verifications, the multi-model ensemble Stacking and two-layer feature learning framework proposed in this invention demonstrates significant accuracy advantages and good engineering applicability in the task of predicting day-ahead electricity prices in the electricity spot market. The prediction results can be directly used in downstream bidding strategy models, improving price spread direction judgment and coefficient optimization by providing more accurate day-ahead electricity price estimates, thereby enhancing the overall trading revenue of electricity sales companies.
[0210] Industrial applicability
[0211] This invention can be widely applied to decision support systems for electricity spot market transactions, and is suitable for day-ahead electricity price forecasting scenarios in various pilot provinces. The method of this invention can be implemented through software programs and deployed on computer equipment, and has broad industrial application prospects.
[0212] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for predicting day-ahead electricity spot prices based on multi-model ensemble stacking and two-layer feature learning, characterized in that, Includes the following steps: The data preparation steps involve acquiring historical market clearing data and calendar data, and then using a three-level progressive filling strategy—imposing recent simultaneous point filling, multi-day average filling, and feature removal—to process missing values in the prediction set. The holiday feature compensation step involves determining whether the forecast mode is in advance. Advance forecast mode predicts electricity prices for future holidays one working day prior to the forecast date. Based on the calendar data, it is determined whether the forecast day is a holiday or a weekend. If in advance forecast mode and the forecast day is a holiday or a weekend, a differentiated feature compensation strategy is executed based on the holiday type. This strategy includes: replacing statutory holidays with feature data from the last working day before the holiday; and constructing a weekend forecast using the moving average of features from multiple working days before the holiday. Otherwise, no feature compensation is performed. The feature engineering steps involve constructing in parallel a first feature set for the lightweight gradient boosting master model, a second feature set for the long short-term memory network time series model, and a third feature set for the extreme gradient boosting auxiliary model. The first feature set includes business supply and demand features, multi-window moving average features, and fluctuation features. The second feature set includes time series periodic coding features and composite business features. The third feature set includes thermal power prediction features constructed based on the physical constraints of the power system. The multi-model parallel prediction step involves inputting the first feature set into a trained lightweight gradient boosting master model to obtain a first prediction result, inputting the second feature set into a trained long short-term memory network time series model to obtain a second prediction result, and inputting the third feature set into a trained extreme gradient boosting auxiliary model to obtain a third prediction result. The lightweight gradient boosting master model is used to capture the nonlinear relationship between features and electricity price, the long short-term memory network time series model is used to capture the time dependency of electricity price, and the extreme gradient boosting auxiliary model is used to provide prediction results from a different perspective than the lightweight gradient boosting master model. In the stacking fusion step, when the lightweight gradient boosting master model, the long short-term memory network time series model, and the extreme gradient boosting auxiliary model are all enabled and the prediction results are complete, a linear regression meta-model is obtained. The first, second, and third prediction results are then input into the linear regression meta-model for prediction to obtain the final fused predicted electricity price. If any condition is not met, the first prediction result is used as the final fused predicted electricity price. The post-processing step involves trimming and outputting the final fused predicted electricity price based on the preset price floor configuration for each province.
2. The day-ahead electricity price forecasting method based on multi-model ensemble Stacking and two-layer feature learning according to claim 1, characterized in that, The Long Short-Term Memory (LSTM) network temporal model employs a dual-attention network architecture, which includes: The feature attention module uses the Sigmoid gating mechanism to independently calculate the attention weight for each dimension of the second feature set input to the Long Short-Term Memory Network temporal model, and then performs element-wise weighting of the attention weight with the second feature set. A bidirectional long short-term memory network layer is used to model the forward and backward temporal dependencies of the weighted features and output the hidden state sequence. A temporal attention module receives the hidden state sequence, calculates the attention weights for each time step using the Tanh activation function and Softmax normalization, and performs a weighted summation of the hidden state sequence based on the attention weights to obtain a context vector; and The residual connection module directly connects the original features of the last time step in the second feature set to the fully connected output layer through a linear mapping.
3. The day-ahead electricity price forecasting method based on multi-model ensemble stacking and two-layer feature learning according to claim 1, characterized in that, The Long Short-Term Memory Network time series model employs an adaptive price penalty loss function during training. This function assigns differentiated penalty factors based on the range of the actual electricity price, thereby imposing higher weights on the prediction error in high-price ranges.
4. The day-ahead electricity price forecasting method based on multi-model ensemble Stacking and two-layer feature learning according to claim 3, characterized in that, The adaptive price penalty loss function is expressed as follows: ; in, This represents the true value of the electricity price. For predicted values, The total number of samples, It is a piecewise step function, which has The penalty factor is 8.0 when the price is ≥600 yuan / MWh.
5. The day-ahead electricity price forecasting method based on multi-model ensemble Stacking and two-layer feature learning according to claim 1, characterized in that, The feature engineering steps also include: A trained class gradient boosting classification model is used to classify electricity price ranges to output range prediction labels. The class gradient boosting classification model is a classification model based on the class gradient boosting algorithm. The interval prediction labels are concatenated as category features into the first feature set for training and prediction of the lightweight gradient boosting machine master model.
6. The day-ahead electricity price forecasting method based on multi-model ensemble Stacking and two-layer feature learning according to claim 1, characterized in that, The three-level progressive filling strategy includes: The first level involves filling missing values in the prediction set with values from the training set for the most recent day at the same time. The second level involves filling missing values after the first level using the average of data from the same point 30 days prior to the forecast date; and At the third level, for feature columns that are still empty after being filled at the second level, if they are empty at all points in time within 30 consecutive days, the entire feature column is removed. After removal, the first feature set, the second feature set, and the third feature set are all constructed based on the remaining feature columns after removal.
7. The day-ahead electricity price forecasting method for electricity spot market based on multi-model ensemble Stacking and two-layer feature learning according to claim 1, characterized in that, The linear regression meta-model is updated monthly on a rolling basis, and the rolling update includes: On a monthly basis, the linear regression meta-model is retrained using the historical prediction results of the lightweight gradient boosting master model, the long short-term memory network time series model, and the extreme gradient boosting auxiliary model from the previous month, along with the corresponding actual electricity price. Name and save the trained linear regression meta-model by province and month; The pre-trained linear regression model is loaded for daily forecasting, and the parameters of the latest month's linear regression model are automatically loaded for forecasting when forecasting across months. If the linear regression meta-model for the corresponding month does not exist, it will be automatically retrained using historical data.
8. A day-ahead electricity price forecasting system based on multi-model ensemble stacking and two-layer feature learning for implementing the aforementioned day-ahead electricity price forecasting method based on multi-model ensemble stacking and two-layer feature learning, characterized in that, include: The data preparation module is used to acquire historical market clearing data and calendar data, and uses a three-level progressive filling strategy to process missing values in the prediction set, which sequentially performs filling of recent simultaneous points, filling of multi-day average values, and feature removal. The holiday feature compensation module is used to determine whether it is in advance prediction mode. The advance prediction mode is a mode that predicts the electricity price of future holidays one working day before the prediction date, and determines whether the prediction date is a holiday or a weekend based on the calendar data. If it is in advance prediction mode and the prediction date is a holiday or a weekend, a differentiated feature compensation strategy is executed according to the holiday type. Otherwise, feature compensation processing will not be performed; The feature engineering module is used to construct in parallel a first feature set for the lightweight gradient boosting master model, a second feature set for the long short-term memory network temporal model, and a third feature set for the extreme gradient boosting auxiliary model. A multi-model parallel prediction module is used to input the first feature set into a trained lightweight gradient boosting main model to obtain a first prediction result, input the second feature set into a trained long short-term memory network time series model to obtain a second prediction result, and input the third feature set into a trained extreme gradient boosting auxiliary model to obtain a third prediction result. The lightweight gradient boosting main model is used to capture the nonlinear relationship between features and electricity price, the long short-term memory network time series model is used to capture the time dependency of electricity price, and the extreme gradient boosting auxiliary model is used to provide prediction results from a different perspective than the lightweight gradient boosting main model. The Stacking fusion module is used to obtain a linear regression meta-model when the lightweight gradient boosting master model, the long short-term memory network time series model, and the extreme gradient boosting auxiliary model are all enabled and the prediction results are complete. The module then inputs the first, second, and third prediction results into the linear regression meta-model for prediction to obtain the final fused predicted electricity price. If any condition is not met, the first prediction result is used as the final fused predicted electricity price. The post-processing module is used to trim and output the final fused predicted electricity price according to the preset price lower limit configuration for each province.
9. The day-ahead electricity price forecasting system for electricity spot market based on multi-model ensemble Stacking and two-layer feature learning according to claim 8, characterized in that, The system adopts a province-based plug-in architecture, which includes: A general prediction engine base class, encapsulating the general process of data preprocessing, model training and prediction invocation, and splitting the training and prediction sets; and The province subclass inherits from the general prediction engine base class and overrides the feature engineering method to achieve differentiated business adaptation for different provinces; The system's main process automatically routes to the corresponding province subclass for execution based on the preset province configuration mapping relationship.
10. The day-ahead electricity price forecasting system based on multi-model ensemble stacking and two-layer feature learning according to claim 8, characterized in that, The linear regression meta-model in the Stacking fusion module is updated monthly on a rolling basis, and the rolling update includes: On a monthly basis, the linear regression meta-model is retrained using the historical prediction results of the lightweight gradient boosting master model, the long short-term memory network time series model, and the extreme gradient boosting auxiliary model from the previous month, along with the corresponding actual electricity price. Name and save the trained linear regression meta-model by province and month; The pre-trained linear regression model is loaded for daily forecasting, and the parameters of the latest month's linear regression model are automatically loaded for forecasting when forecasting across months. If the linear regression meta-model for the corresponding month does not exist, it will be automatically retrained using historical data.