This paper studies the predictability of firm profits using Fama-MacBeth regressions and gradient boosting. Gradient boosting can use more relevant factors and it predicts better. Profits are more predictable at firms that are large, investment grade, low R&D, low market-to-book, low cash flow volatility. Effects on financing decisions, and cross-section of stock returns are studied. During recessions profits are less predictable - particularly non-investment grade firms. Both algorithms produce estimates like those interpreted in the literature as evidence of excessive human optimism during booms and excessive pessimism during recessions.