Reducing carbon emissions from the construction industry has been vital to addressing the growing global environmental change challenge. Building energy consumption data is crucial to many applications, such as carbon emission auditing, energy efficiency improvement, etc. This study aims to mine the energy consumption patterns of commercial buildings and explore the applicability of a data-driven model in building carbon emissions prediction. This research selected Dalian's large-scale green commercial building as a case study. The electrical load data for the past four years were collected, and the indoor and outdoor environmental data were monitored under different seasons. Machine learning was used to develop building carbon emissions forecasting models. The average annual increase rate of building electricity consumption before the pandemic was 5.9%. Miscellaneous electric loads (MELs) is the largest electricity consumer in the target building. On typical days, indoor illuminance and CO2 are highly correlated under different seasons. A forecasting model based on ensemble learning is found to have certain advantages in building carbon emissions prediction.