The growing importance of mitigating climate change and decarbonization of the building sector has shed light on the urgency of retrofitting as a means to reach sustainability goals, especially in existing and heritage structures. This study uses a data-driven approach to assess the possibility of integrating solar power systems into historically significant structures, with the goal of enhancing energy efficiency while preserving architectural and cultural identity. A dataset of 1000 entries, including architectural features and energy metrics, was cleaned, normalized, and analyzed in MATLAB. Five classification algorithms – Decision Tree, Naïve Bayes, Multilayer Neural Network (MNN), Support Vector Machine (SVM), and Logistic Regression – were trained to predict optimal solar utilization. Decision Tree demonstrated the highest predictive accuracy at 99.67%, with MNN and SVM following closely at 95.28% and 94.17%, respectively. The results highlight the potential of machine learning in guiding suitable retrofitting opportunities for green energy integration in heritage architecture by considering context-sensitive parameters, offering a practical framework that aligns with both heritage protection strategies and climate resilience efforts. © The Author(s), under exclusive license to Springer Nature Switzerland AG 2026.