 This paper evaluated four ensemble learning algorithms, adaptive boosting, eta-boost, bagging, gradient boosting, histogram-based gradient boosting, and random forest, for predicting energy prices in Latin America, particularly in a case study on Mexico. It also used seasonal decomposition to reduce unrepresentative variations. The optina algorithm was then used to optimize the structure of the ensembles by combining multiple ensemble frameworks. The results showed that the proposed hybrid ensemble learning method had better performance than the state-of-the-art ensemble learning methods, with a mean-squared error of 3.37 times 10 sub minus 9 a slash sub. This article was authored by and Carolina Rodriguez-Clar, Stefano Frizzo-Stefanon, Leo Oriol Simon, and others.