Intelligent energy saving and energy efficiency technologies are the modern large-scale global trend in the energy systems development. The demand for smart buildings is growing not only in the world, but also in Russia, especially in the market of construction and operation of large business centers, shopping centers and other business projects. Accurate cost estimates are important for promoting energy efficiency construction projects and demonstrating their economic attractiveness. The growing number of digital measurement infrastructure, used in commercial buildings, led to increase access to high-frequency data that can be used for anomaly detection and diagnostics of equipment, heating, ventilation, and optimization of air conditioning. This led to the use of modern and efficient machine learning methods that provide promising opportunities to obtain more accurate forecasts of energy consumption of the buildings, and thus increase energy efficiency. In this paper, based on the gradient boosting model, a method of modeling and forecasting the energy consumption of buildings is proposed and computer algorithms are developed to implement it. Energy consumption dataset of 300 commercial buildings was used to assess the effectiveness of the proposed algorithms. Computer simulations showed that the use of these algorithms has increased the accuracy of the prediction of energy consumptionin more than 80 percent of cases compared to other machine learning algorithms.