Hybrid machine learning framework for electrical grid stability prediction using comparative model evaluation
Abstract
Accurately predicting electrical grid stability is essential to ensuring the reliability, resilience, and sustainable operation of modern smart energy systems. The nonlinear interactions among the grid operating parameters make stability prediction challenging, particularly when conventional machine learning models depend primarily on statistical relationships, without clearly incorporating physically meaningful characteristics. This study presents a systematic comparative evaluation of machine-learning and deep-learning approaches for electrical grid stability prediction using the Electrical Grid Stability Simulated Dataset, comprising 10,000 observations from a decentralized four-node star-topology power system. Six conventional machine learning models - Logistic Regression, Random Forest, Gradient Boosting, XGBoost, LightGBM, and Support Vector Machine with an RBF kernel are compared with four deep-learning architectures, namely Deep Multilayer Perceptron, 1D-CNN, CNN-LSTM, and Bi-LSTM. We also develop a hybrid stacking ensemble to integrate complementary representations from high-performing boosting models through a linear meta-learner. To incorporate domain knowledge, seven physics-informed features are engineered from the original 12 grid parameters, producing a 19-dimensional feature space. Model performance is evaluated using accuracy, weighted F1-score, ROC- AUC, Matthews correlation coefficient, and class-wise precision and recall, evaluated using stratified fivefold cross-validation. SHAP-based analysis is employed to quantify feature contributions and improve model interpretability. The proposed hybrid stacking ensemble achieves the best overall predictive performance, obtaining an accuracy of 96.85%, weighted F1 score of 0.9685, ROC-AUC of 0.9953, and MCC of 0.9319. The results demonstrate that integrating complementary ensemble learners provides more reliable stability discrimination than individual conventional and deep learning models. SHAP analysis further indicates that physics- informed interaction features, particularly τ− P interaction and power balance characteristics, provide substantial discriminatory information when combined with the original grid reaction time parameters. The findings demonstrate that hybrid ensemble learning combined with physics-informed feature engineering will provide accurate, interpretable, and computationally practical solutions for electrical grid stability prediction. The strong predictive discrimination and consistent cross-validation performance indicate its potential for real-time stability monitoring and decision support in smart-grid environments. The integration of domain-informed representations with data-driven learning offers a promising direction for developing more transparent and reliable intelligent grid-monitoring systems.