Precise predictions of solar photovoltaic (PV) energy production have an important role in day-ahead planning of power grid and power plant operators since they help to improve stability and power quality of the electricity distributed. In this work, the machine learning (ML) algorithm, called as the LightGBM, is applied to the challenge of forecasting energy yield of PV power plants. We compare the performance of the LightGBM with different ML and empirical models. The advantages of the LightGBM are highlighted and this model is introduced as a new approach to be used in the forecast of PV energy. We trained and tested the models using 2 years of operational data in 30 min re-sampling resolution. The prediction results on the test set showed nRMSE of 1.56 % for the LightGBM model, and processing time of 0.181 s, presenting much better accuracy than empirical models, comparable accuracy than other ML models, and outperforming in terms of processing time being significantly faster than the rest of models studied.