A new project demonstrates how machine learning can forecast corporate earnings surprises—the difference between reported earnings and analyst expectations—with high precision. By analyzing historical earnings data, stock price behavior, volatility, momentum, and trading activity from major companies like Apple, Microsoft, Amazon, and Nvidia, the model achieves an accuracy rate of nearly 89% on test data.
The analysis defines an earnings surprise as the percentage difference between actual EPS and consensus estimates. Historical earnings and market data were collected via Yahoo Finance, and features such as 5-day returns, 20-day returns, volatility, and momentum were engineered. An XGBoost classifier was trained to predict whether a company would beat expectations, and the system was later expanded to estimate the magnitude of the surprise using regression models.
Predictions are generated for multiple companies, producing both the probability of an earnings beat and the estimated surprise percentage. The project also evolves into a multi-class classification system that categorizes outcomes into 'Big Beat,' 'Beat,' 'Inline,' 'Miss,' and 'Big Miss.' This approach could support trading or investment decisions by providing data-driven insights into upcoming earnings reports.