توقع أسعار الكهرباء باستخدام نماذج ميتا جماعية ومفسري SHAP: نهج مدفوع بتحليل المكونات الرئيسية
Electricity price forecasting with ensemble meta-models and SHAP explainers: a PCA-driven approach

شارك:
المجلة: Scientific Reports، المجلد: 16، العدد: 1
DOI: https://doi.org/10.1038/s41598-026-35839-1
PMID: https://pubmed.ncbi.nlm.nih.gov/41606033
تاريخ النشر: 2026-01-28
المؤلف: Amirhosein Hayati وآخرون
الموضوع الرئيسي: تحميل الطاقة وتوقعات القدرة

نظرة عامة

تقدم هذه الورقة البحثية إطار عمل جديد للنمذجة المجمعة تهدف إلى تحسين توقعات أسعار الكهرباء قبل ساعة. يدمج الإطار تقنيات تعلم الآلة المختلفة، وبشكل خاص XGBoost وLSTM وCNN، مع SHAP (SHapley Additive exPlanations) من أجل القابلية للتفسير وPCA (تحليل المكونات الرئيسية) لتقليل الأبعاد. تم استخدام استراتيجيتين مجمعتين: المتوسط المرجح، الذي حقق خطأ الجذر التربيعي المتوسط (RMSE) قدره 2.126761، ومجموعة النماذج المجمعة باستخدام الانحدار الخطي، التي تفوقت على الآخرين مع RMSE قدره 1.939032. كشفت تحليل SHAP أن XGBoost وLSTM كانا محوريين في أداء النموذج، بينما أكد تحليل مسار الخطأ فعالية المجموعات في تقليل الأخطاء التراكمية في التوقعات.

تخلص الدراسة إلى أن مجموعة النماذج المجمعة تعزز بشكل كبير دقة التوقعات من خلال الاستفادة من نقاط القوة في نماذج متعددة. لم يوضح تطبيق إطار SHAP العوامل الرئيسية التي تؤثر على أسعار الكهرباء—مثل توقعات أسعار TSO، والاستهلاك الفعلي، وظروف الطقس—فحسب، بل قدم أيضًا شفافية في عملية اتخاذ القرار للنموذج. تسلط هذه الدراسة الضوء على الدور الحاسم لأساليب التجميع والذكاء الاصطناعي القابل للتفسير في تحقيق توقعات موثوقة وتعزيز الثقة بين المشاركين في السوق وصانعي السياسات في قطاع الطاقة.

مقدمة

تسلط مقدمة الورقة البحثية الضوء على تعقيدات سوق الكهرباء، الذي يتشكل من خلال عوامل متعددة بما في ذلك أنماط الاستهلاك، ومصادر التوليد، وظروف الطقس، والتأثيرات التنظيمية. مع الزيادة في دمج مصادر الطاقة المتجددة، أصبحت الحاجة إلى توقعات دقيقة لأسعار الكهرباء أمرًا حاسمًا لأصحاب المصلحة وصانعي السياسات. تكافح طرق التوقع التقليدية لالتقاط التقلبات الجوهرية والطبيعة متعددة العوامل لتسعير الكهرباء، مما يدفع لاستكشاف منهجيات متقدمة مثل تعلم الآلة (ML) والتعلم العميق (DL). أظهرت تقنيات مثل XGBoost وذاكرة المدى الطويل والقصير (LSTM) والشبكات العصبية التلافيفية (CNN) إمكانات في نمذجة هذه العلاقات المعقدة، لا سيما في بيانات السلاسل الزمنية.

على الرغم من دقتها التنبؤية، غالبًا ما تعمل هذه النماذج ML وDL كـ “صناديق سوداء”، مما يجعل من الصعب تفسير مساهمات العوامل المختلفة في توقعاتها. تهدف هذه الدراسة إلى معالجة هذه المشكلة المتعلقة بالقابلية للتفسير من خلال استخدام SHAP (SHapley Additive exPlanations) وتقنيات التجميع المتقدمة. تؤكد الدراسة على التحديات الفريدة لتوقع أسعار الكهرباء، لا سيما بسبب تفاعل التأثيرات المتنوعة مثل تقلبات الطاقة المتجددة وتقلبات السوق. من خلال تطوير إطار عمل يعزز كل من الأداء التنبؤي والقابلية للتفسير، تسعى الدراسة إلى تحسين الفائدة العملية لنماذج التوقعات في سوق الكهرباء الديناميكي.

الطرق

تركز منهجية هذه الدراسة على توقع أسعار الكهرباء في إسبانيا باستخدام مجموعة بيانات شاملة تمتد على أربع سنوات، والتي تشمل متغيرات مثل استهلاك الكهرباء، والتوليد، والأسعار، وظروف الطقس. تم الحصول على البيانات من الشبكة الأوروبية لمشغلي أنظمة نقل الكهرباء (ENTSOE) لمقاييس الاستهلاك والتوليد، والشبكة الكهربائية الإسبانية (REE) لمعلومات الأسعار، وOpen Weather API لبيانات الطقس من أكبر خمس مدن في إسبانيا. تم تقييم الأداء التنبؤي للنماذج باستخدام مقاييس مثل خطأ الجذر التربيعي المتوسط (RMSE).

لتحسين قابلية تفسير النتائج، تم استخدام تحليل SHAP (SHapley Additive exPlanations) لترتيب أهمية الميزات المختلفة، بينما تم استخدام تحليل المكونات الرئيسية (PCA) لتقليل الأبعاد أثناء معالجة البيانات. توضح الدراسة منهجيتها بشكل منهجي، التي تدمج تقنيات تعلم الآلة المتقدمة، واستراتيجيات المعالجة المسبقة، وأدوات الشفافية، بهدف تحسين دقة وقابلية تفسير توقعات أسعار الكهرباء.

النتائج

في قسم النتائج، يتم تقييم أداء النماذج المختلفة لتوقع أسعار الكهرباء. حقق نموذج ذاكرة المدى الطويل والقصير (LSTM)، المدرب بمعدل تعلم قدره 0.001 على مدى 100 دورة، خطأ الجذر التربيعي المتوسط (RMSE) قدره 2.195، مما يدل على قدرته على التقاط الاعتماديات الزمنية على الرغم من التعقيدات الجوهرية للمهمة. تُظهر اتجاهات خسارة التدريب والتحقق من الصحة تقارب النموذج، بينما تعكس قيم RMSE عبر مجموعات البيانات أدائه التنبؤي.

على النقيض من ذلك، أظهر نموذج LSTM المكدس RMSE أعلى قدره 3.948، مما يشير إلى الإفراط في التكيف بسبب هيكله الأعمق، الذي، على الرغم من كفاءته في تعلم الميزات المعقدة، فقد أثر على التعميم. توضح اتجاهات خسارة التدريب والتحقق من الصحة لهذا النموذج هذه التحديات بشكل أكبر. سجل نموذج الهجين CNN-LSTM، الذي يدمج نقاط القوة في الشبكات العصبية التلافيفية (CNNs) وLSTMs، RMSE قدره 2.227، مما يلتقط بفعالية الاعتماديات قصيرة وطويلة الأجل. للتخفيف من القيود الملحوظة في النماذج الفردية، تم استخدام أساليب التجميع، مستفيدة من نقاط القوة التكميلية لأساليب متعددة.

المناقشة

تسلط قسم المناقشة في الورقة البحثية الضوء على الديناميكيات المتناقضة لتوقع أسعار الكهرباء في إسبانيا وإيران، مع التأكيد على تأثير توليد الطاقة المتجددة، وترابط السوق، وأسعار الغاز الطبيعي في إسبانيا، مقارنةً باعتماد إيران على الوقود الأحفوري. تحدد الدراسة أنه بينما قد تؤدي نماذج تعلم الآلة مثل XGBoost وLSTM وCNN بشكل مشابه عبر كلا المنطقتين، تختلف الميزات التنبؤية بشكل كبير. في إسبانيا، تعتبر عوامل مثل أسعار الغاز الطبيعي وأنماط توليد الطاقة المتجددة محورية، بينما تلعب تقلبات أسعار النفط دورًا أكثر أهمية في إيران بسبب تكاليف الطاقة المدعومة في البلاد.

علاوة على ذلك، تستخدم الدراسة SHAP (SHapley Additive exPlanations) لتعزيز قابلية تفسير النموذج، مما يوفر رؤى حول أهمية الميزات ومعالجة التحديات المتعلقة بشفافية نماذج تعلم الآلة. كما توضح الدراسة فعالية تحليل المكونات الرئيسية (PCA) في تحسين الكفاءة الحسابية وأداء النموذج. من خلال دمج النمذجة المجمعة مع تقنيات الشفافية، تقدم الدراسة إطار عمل جديد لتوقع أسعار الكهرباء يكون قابلًا للتفسير وقابلًا للتوسع، مما يساهم برؤى قيمة في مجالات اقتصاديات الطاقة والتوقعات.

Journal: Scientific Reports, Volume: 16, Issue: 1
DOI: https://doi.org/10.1038/s41598-026-35839-1
PMID: https://pubmed.ncbi.nlm.nih.gov/41606033
Publication Date: 2026-01-28
Author(s): Amirhosein Hayati et al.
Primary Topic: Energy Load and Power Forecasting

Overview

This research paper presents a novel ensemble meta-modeling framework aimed at improving hour-ahead electricity price forecasting. The framework integrates various machine learning techniques, specifically XGBoost, LSTM, and CNN, with SHAP (SHapley Additive exPlanations) for interpretability and PCA (Principal Component Analysis) for dimensionality reduction. Two ensemble strategies were employed: Weighted Averaging, which achieved a root mean square error (RMSE) of 2.126761, and a Meta-Model Ensemble using Linear Regression, which outperformed the others with an RMSE of 1.939032. The SHAP analysis revealed that XGBoost and LSTM were pivotal in the model’s performance, while error trajectory analysis confirmed the ensembles’ effectiveness in reducing cumulative forecasting errors.

The study concludes that the Meta Model Ensemble significantly enhances forecasting accuracy by leveraging the strengths of multiple models. The application of the SHAP framework not only elucidated the key factors influencing electricity prices—such as TSO price forecasts, actual consumption, and weather conditions—but also provided transparency in the model’s decision-making process. This research highlights the critical role of ensemble methods and explainable AI in achieving reliable predictions and fostering trust among market participants and policymakers in the energy sector.

Introduction

The introduction of the research paper highlights the complexities of the electricity market, which is shaped by various factors including consumption patterns, generation sources, weather conditions, and regulatory influences. With the increasing integration of renewable energy sources, the need for accurate electricity price forecasting has become critical for stakeholders and policymakers. Traditional forecasting methods struggle to capture the inherent volatility and multifactorial nature of electricity pricing, prompting the exploration of advanced methodologies such as machine learning (ML) and deep learning (DL). Techniques like XGBoost, Long Short-Term Memory (LSTM), and Convolutional Neural Networks (CNN) have shown potential in modeling these complex relationships, particularly in time series data.

Despite their predictive accuracy, these ML and DL models often operate as “black boxes,” making it difficult to interpret the contributions of various factors to their predictions. This research aims to address this interpretability issue by employing SHAP (SHapley Additive exPlanations) and advanced ensemble techniques. The study underscores the unique challenges of forecasting electricity prices, particularly due to the interplay of diverse influences such as renewable energy variability and market fluctuations. By developing a framework that enhances both predictive performance and interpretability, the research seeks to improve the practical utility of forecasting models in the dynamic electricity market.

Methods

The methodology of this study focuses on forecasting electricity prices in Spain using a comprehensive dataset that spans four years, which includes variables such as electricity consumption, generation, prices, and weather conditions. Data was sourced from the European Network of Transmission System Operators for Electricity (ENTSOE) for consumption and generation metrics, Red Eléctrica de España (REE) for pricing information, and the Open Weather API for weather data from Spain’s five largest cities. The predictive performance of the models was assessed using metrics like Root Mean Square Error (RMSE).

To enhance the interpretability of the results, SHAP (SHapley Additive exPlanations) analysis was utilized to rank the importance of various features, while Principal Component Analysis (PCA) was employed to reduce dimensionality during data preprocessing. The study systematically outlines its methodology, which integrates advanced machine learning techniques, preprocessing strategies, and tools for explainability, aiming to improve the accuracy and interpretability of electricity price forecasts.

Results

In the results section, the performance of various models for electricity price prediction is evaluated. The Long Short-Term Memory (LSTM) model, trained with a learning rate of 0.001 over 100 epochs, achieved a test Root Mean Square Error (RMSE) of 2.195, indicating its capability to capture temporal dependencies despite the inherent complexities of the task. Training and validation loss trends demonstrate the model’s convergence, while RMSE values across datasets reflect its predictive performance.

In contrast, the Stacked LSTM model exhibited a higher RMSE of 3.948, suggesting overfitting due to its deeper architecture, which, while adept at learning intricate features, compromised generalization. The training and validation loss trends for this model further illustrate these challenges. The CNN-LSTM hybrid model, which integrates the strengths of Convolutional Neural Networks (CNNs) and LSTMs, recorded an RMSE of 2.227, effectively capturing both short-term and long-term dependencies. To mitigate the limitations observed in individual models, ensemble methods were employed, harnessing the complementary strengths of multiple approaches.

Discussion

The discussion section of the research paper highlights the contrasting dynamics of electricity price forecasting in Spain and Iran, emphasizing the influence of renewable energy generation, market coupling, and natural gas prices in Spain, compared to Iran’s reliance on fossil fuels. The study identifies that while machine learning models like XGBoost, LSTM, and CNN may perform similarly across both regions, the predictive features differ significantly. In Spain, factors such as natural gas prices and renewable generation patterns are pivotal, whereas in Iran, oil price fluctuations play a more critical role due to the country’s subsidized energy costs.

Furthermore, the research employs SHAP (SHapley Additive exPlanations) to enhance model interpretability, providing insights into feature importance and addressing challenges related to the transparency of machine learning models. The study also demonstrates the effectiveness of Principal Component Analysis (PCA) in improving computational efficiency and model performance. By integrating ensemble modeling with explainability techniques, the research presents a novel framework for electricity price forecasting that is both interpretable and scalable, contributing valuable insights to the fields of energy economics and forecasting.