Abstract
This study investigates the predictive performance and interpretability of a Long Short-Term Memory (LSTM) model in comparison with conventional machine learning approaches, namely Extreme Gradient Boosting (XGBoost) and Random Forest (RF), for short-term photovoltaic (PV) energy forecasting. Using a high-resolution time-series dataset comprising 9,854 observations from a single PV system, the study addresses the challenge of accurately modeling highly stochastic solar energy generation while enhancing model transparency. The results demonstrate that LSTM outperforms the benchmark models, achieving the highest accuracy (R² = 0.65, RMSE ≈ 2.00, MAE ≈ 1.04), whereas XGBoost (R² ≈ 0.58) and RF (R² ≈ 0.41) exhibit comparatively lower performance, highlighting the limitations of tree-based methods in capturing temporal dependencies. Model interpretability is examined using SHapley Additive exPlanations (SHAP), which identify global solar irradiance and trigonometric temporal features (day_sin, hour_cos) as the dominant drivers of PV output. Furthermore, SHAP interaction analysis reveals a physically consistent relationship between irradiance and temperature, indicating that the positive contribution of solar radiation becomes more pronounced under elevated temperature conditions. The findings demonstrate that integrating deep learning with explainable artificial intelligence provides not only improved predictive accuracy but also enhanced transparency, addressing a critical barrier to the practical deployment of data-driven PV forecasting models.