This article adopts a machine learning method called stacked generalization for forecasting mortality. The main idea is to combine the forecasts from different projection models or algorithms in a certain way in order to increase the prediction accuracy. In particular, the article considers not just the traditionally used mortality projection models, such as the Lee–Carter and CBD models and their extensions, but also some learning algorithms called feedforward and recurrent neural networks that are starting to gain attention in the actuarial literature. For blending the different forecasts, the article examines a number of choices, including simple averaging, weighted averaging, linear regression, and neural network. Using U.S. mortality data, it is found that the proposed stacking approach often outperforms the cases where a projection model or algorithm is applied individually, and that neural networks tend to generate better results than many of the traditional models.