The essentials

  1. The result. Across 916 out-of-sample forecasts from 2017 to 2023, the analyst consensus was off by $0.17 a share on average. Random Forest was off by $0.58 and XGBoost by $0.59: about 3.4 times less precise.
  2. The sectors. The models lost in all ten sectors tested. The gap was narrowest in real estate (1.24 times the analysts' error) and widest in utilities (11.5 times).
  3. The crisis. During Covid the analysts' error rose 17%. Random Forest's rose 22% and XGBoost's 26%. The models were supposed to be the steadier hand; they were not.
  4. The macro data. Adding the VIX, interest rates, inflation and the yield spread moved XGBoost's error from $0.587 to $0.595. The difference is not statistically significant (Diebold-Mariano −1.04, p = 0.297).
  5. The limit. The models read accounts. Analysts also hear guidance, earnings calls and management. This test measures what that difference is worth on large, closely followed companies; it does not measure what newer, text-reading models could do.

1. Three times further from the mark

The pitch for machine learning in equity research is familiar. Analysts are slow, optimistic and inclined to huddle around one another's numbers; an algorithm has no management relationship to protect and no reputation to lose. Machine learning has already shown what it can do with stock returns (Gu, Kelly and Xiu, 2020). Feed it enough accounting data and it should forecast earnings better than the people paid to do so.

The study behind this article, a master's thesis completed at INSEEC in 2025-26, tested that claim on a deliberately ordinary setup: two tree-based models that any quantitative team can run, trained on public data. It set out three hypotheses, each favourable to the machines. All three failed.

The headline number is the mean absolute error, the average distance in dollars between a forecast of earnings per share and the figure the company went on to report. For the consensus it was $0.1722. For Random Forest it was $0.5769; for XGBoost, $0.5868. A version of XGBoost given macroeconomic data did slightly worse still, at $0.5950.

Chart 1
The consensus misses by 17 cents. The models miss by 58 or more
Error of next-quarter EPS forecasts on three measures, 916 forecasts, 2017-2023

Pick a measure; hover or tap a row for the detail

Analyst consensus$0.172Analyst consensus: $0.172The benchmark: the average of analysts' estimates, as recorded by Alpha VantageAll three measures put the consensus firstMAE $0.1722, RMSE 0.3765, MAPE 15.68%
Random Forest$0.577 3.4xRandom Forest: $0.577Hundreds of decision trees averaged; fundamentals and earnings history only3.4 times the consensus errorMAE $0.5769, RMSE 0.8948, MAPE 63.32%
XGBoostfundamentals only$0.587 3.4xXGBoost (fundamentals only): $0.587Trees built in sequence, each correcting the last; same inputs as Random Forest3.4 times the consensus errorMAE $0.5868, RMSE 0.9115, MAPE 63.12%
XGBoostfundamentals + macro$0.595 3.5xXGBoost (fundamentals + macro): $0.595Same model plus the VIX, interest rates, inflation and the yield spread3.5 times the consensus errorMAE $0.5950, RMSE 0.9231, MAPE 64.18%
Analyst consensus0.377Analyst consensus: 0.377The benchmark: the average of analysts' estimates, as recorded by Alpha VantageAll three measures put the consensus firstMAE $0.1722, RMSE 0.3765, MAPE 15.68%
Random Forest0.895 2.4xRandom Forest: 0.895Hundreds of decision trees averaged; fundamentals and earnings history only2.4 times the consensus RMSEMAE $0.5769, RMSE 0.8948, MAPE 63.32%
XGBoostfundamentals only0.911 2.4xXGBoost (fundamentals only): 0.911Trees built in sequence, each correcting the last; same inputs as Random Forest2.4 times the consensus RMSEMAE $0.5868, RMSE 0.9115, MAPE 63.12%
XGBoostfundamentals + macro0.923 2.5xXGBoost (fundamentals + macro): 0.923Same model plus the VIX, interest rates, inflation and the yield spread2.5 times the consensus RMSEMAE $0.5950, RMSE 0.9231, MAPE 64.18%
Analyst consensus15.7%Analyst consensus: 15.7%The benchmark: the average of analysts' estimates, as recorded by Alpha VantageAll three measures put the consensus firstMAE $0.1722, RMSE 0.3765, MAPE 15.68%
Random Forest63.3% 4.0xRandom Forest: 63.3%Hundreds of decision trees averaged; fundamentals and earnings history only4.0 times the consensus percentage errorMAE $0.5769, RMSE 0.8948, MAPE 63.32%
XGBoostfundamentals only63.1% 4.0xXGBoost (fundamentals only): 63.1%Trees built in sequence, each correcting the last; same inputs as Random Forest4.0 times the consensus percentage errorMAE $0.5868, RMSE 0.9115, MAPE 63.12%
XGBoostfundamentals + macro64.2% 4.1xXGBoost (fundamentals + macro): 64.2%Same model plus the VIX, interest rates, inflation and the yield spread4.1 times the consensus percentage errorMAE $0.5950, RMSE 0.9231, MAPE 64.18%
Source Tezgel (2026), Table 1. MAE: mean absolute error in dollars per share. RMSE penalises large errors. MAPE: error as a share of reported EPS.Le Détroit

The other two measures tell the same story. Root mean squared error, which punishes large misses, was 0.38 for the consensus and between 0.89 and 0.92 for the models: the algorithms were not merely a little off more often, they were badly off more often. Measured as a percentage of the reported figure, the consensus erred by 15.7% and each model by more than 63%.

2. How the test was run

The sample is 44 companies from the S&P 500, the ones for which every input was complete between 2014 and 2023. Reported earnings come from the SEC's EDGAR filings, the consensus from Alpha Vantage, company fundamentals from Orbis and macroeconomic series from FRED, the St Louis Fed's database.

Each model was asked for one thing: next quarter's earnings per share. It was given the company's earnings history (lags, moving averages, a fourth-quarter flag), its fundamentals (operating margin, profitability, leverage, balance-sheet structure) and, in one variant, the macro backdrop.

The protocol matters more than the models. Forecasting studies flatter themselves easily: a single misdated column lets a model peek at the future. Here the models were trained walk-forward. Each was fitted on the quarters available at a given date, asked for the next one, then refitted with that quarter added, and so on to the end of 2023. Every one of the 916 forecasts scored was made on data the model had not seen, and the consensus was scored against the same companies and the same quarters.

3. Ten sectors, ten defeats

A single average can hide a sector where the machine is ahead. There is none. XGBoost, the stronger candidate on paper, trailed the consensus in every sector of the sample.

Chart 2
Closest in real estate, furthest in utilities
XGBoost against the consensus, sector by sector

Hover or tap a sector for the detail

Real estate51 forecasts1.24xReal estate: 1.24xConsensus error $0.259 a share, XGBoost $0.32051 forecasts in the sample
Consumer staples1061.32xConsumer staples: 1.32xConsensus error $0.248 a share, XGBoost $0.327106 forecasts in the sample
Financials962.39xFinancials: 2.39xConsensus error $0.258 a share, XGBoost $0.61896 forecasts in the sample
Consumer discretionary1003.55xConsumer discretionary: 3.55xConsensus error $0.131 a share, XGBoost $0.466100 forecasts in the sample
Industrials1153.72xIndustrials: 3.72xConsensus error $0.257 a share, XGBoost $0.957115 forecasts in the sample
Energy574.49xEnergy: 4.49xConsensus error $0.199 a share, XGBoost $0.89357 forecasts in the sample
Healthcare1294.78xHealthcare: 4.78xConsensus error $0.114 a share, XGBoost $0.544129 forecasts in the sample
Technology1585.15xTechnology: 5.15xConsensus error $0.118 a share, XGBoost $0.610158 forecasts in the sample
Materials368.00xMaterials: 8.00xConsensus error $0.064 a share, XGBoost $0.51236 forecasts in the sample
Utilities6811.46xUtilities: 11.46xConsensus error $0.054 a share, XGBoost $0.61868 forecasts in the sample
Analyst consensusXGBoost
Real estate$0.259
1.24x$0.320
Real estate: 1.24xConsensus error $0.259 a share, XGBoost $0.32051 forecasts in the sample
Consumer staples$0.248
1.32x$0.327
Consumer staples: 1.32xConsensus error $0.248 a share, XGBoost $0.327106 forecasts in the sample
Financials$0.258
2.39x$0.618
Financials: 2.39xConsensus error $0.258 a share, XGBoost $0.61896 forecasts in the sample
Consumer discretionary$0.131
3.55x$0.466
Consumer discretionary: 3.55xConsensus error $0.131 a share, XGBoost $0.466100 forecasts in the sample
Industrials$0.257
3.72x$0.957
Industrials: 3.72xConsensus error $0.257 a share, XGBoost $0.957115 forecasts in the sample
Energy$0.199
4.49x$0.893
Energy: 4.49xConsensus error $0.199 a share, XGBoost $0.89357 forecasts in the sample
Healthcare$0.114
4.78x$0.544
Healthcare: 4.78xConsensus error $0.114 a share, XGBoost $0.544129 forecasts in the sample
Technology$0.118
5.15x$0.610
Technology: 5.15xConsensus error $0.118 a share, XGBoost $0.610158 forecasts in the sample
Materials$0.064
8.00x$0.512
Materials: 8.00xConsensus error $0.064 a share, XGBoost $0.51236 forecasts in the sample
Utilities$0.054
11.46x$0.618
Utilities: 11.46xConsensus error $0.054 a share, XGBoost $0.61868 forecasts in the sample
Source Tezgel (2026), sector table. A multiple of 1x would be a tie. Materials rests on 36 forecasts and should be read with caution.Le Détroit

The pattern is not the obvious one. The models came closest where earnings are steadiest, in real estate and consumer staples, which fits: a model built on past earnings does least harm when the past repeats. But utilities are steady too, and there the model was at its worst.

The explanation is in the analysts' column, not the model's. On utilities the consensus missed by 5 cents a share; the model missed by 62. The model's error in utilities was about the same as in technology or financials. The analysts were simply far better there than anywhere else, in a regulated business where rate decisions and guidance tell a specialist most of what the quarter will hold. The more the answer sits in information outside the accounts, the wider the gap.

4. Covid: the stress test the models failed

The second hypothesis was the most plausible. In a shock, analysts are thought to freeze or herd, while a model keeps processing the data. If machines had an edge anywhere, it should have been in 2020.

Chart 3
Everyone got worse in the crisis. The models got worse faster
Mean absolute error, dollars per share: 835 forecasts outside the Covid period, 81 inside it

Hover or tap a forecaster for the detail

Outside the crisisCovid period
Analyst consensus$0.170
error up 17%$0.199
Analyst consensus: error up 17%Outside the crisis $0.1696 a share (835 forecasts)Covid period $0.1985 a share (81 forecasts)The smallest deterioration of the three
Random Forest$0.566
error up 22%$0.689
Random Forest: error up 22%Outside the crisis $0.5660 a share (835 forecasts)Covid period $0.6891 a share (81 forecasts)3.3 times the consensus outside the crisis, 3.5 times inside it
XGBoost + macro$0.582
error up 26%$0.734
XGBoost + macro: error up 26%Outside the crisis $0.5815 a share (835 forecasts)Covid period $0.7342 a share (81 forecasts)3.4 times the consensus outside the crisis, 3.7 times inside it
Source Tezgel (2026), Annex 5.3. Percentage changes are Le Détroit's calculation.Le Détroit

It was the reverse. XGBoost went from 3.4 times the consensus error outside the crisis to 3.7 times inside it. A model trained on years of ordinary quarters has nothing in its history that resembles a lockdown, and it extrapolates the old regime into the new one. An analyst can pick up the phone, listen to a chief financial officer withdraw guidance and cut the number the same afternoon.

5. More data, no better

The third hypothesis gave the model what it seemed to be missing: the economy. The enriched XGBoost was given the VIX, interest rates, inflation and the spread between long and short rates. Its error went up, from $0.5868 to $0.5950. The Diebold-Mariano test, the standard check on whether two sets of forecasts differ in accuracy, returned −1.04 with a p-value of 0.297: no detectable effect in either direction.

The model's own weightings show why.

Chart 4
What XGBoost looked at: mostly last year's earnings
Share of the model's feature importance, top five variables

Hover or tap a variable for the detail

Four-quarter average EPS48.4%eps_ma4: 48.4%The average of the last four quarters' earnings per share
Last quarter's EPS9.4%eps_lag1: 9.4%Earnings per share one quarter back
Fourth-quarter flag3.8%is_q4: 3.8%Marks year-end quarters, where earnings behave differently
Operating margin3.5%op_margin: 3.5%The first company fundamental on the list
Yield spreadthe only macro variable3.4%spread: 3.4%Long-term minus short-term interest rates
Source Tezgel (2026), Annex 5.4.Le Détroit

Nearly half of the model's weight sat on one variable, the average of the last four quarters' earnings; the two earnings-history variables together carried 58%. Stripped of its machinery, the model was saying that next quarter will look like the recent past. That is a respectable baseline and a poor rival to people who know what management said last week.

The macro series added little because they are the same for every company on a given date. An inflation print does not say whether a firm can pass its costs on; a policy rate does not say whether its debt is fixed or floating. Turning those numbers into an earnings forecast means knowing each company's exposure, which is the analyst's job.

6. What the analysts know that the models do not

None of this rehabilitates the analyst as an oracle. The academic record on their biases is long. Abarbanell and Bernard (1992) documented analysts under-reacting to earnings news. Forecasts lean optimistic, are revised too slowly and cluster around the consensus, and Lim (2001) argued that some of the optimism is a rational price for access to management. Bradshaw and co-authors (2012) showed that the analysts' edge over simple time-series models depends on the horizon and on the kind of company, and can vanish.

The result here suggests those biases cost less than the information analysts hold. On large, heavily covered American companies, the consensus aggregates specialists who sit through every earnings call, track every guidance revision and follow the sector daily. The models in this test had none of that. They were given structured numbers, and the numbers that matter most for next quarter are frequently not in last quarter's accounts. Much of it is said out loud: Liu, Chi and Wang (2024) measure how much analysts draw from the question-and-answer sessions of earnings conferences.

The studies that report machines matching or beating analysts tend to differ from this one in ways that support the same reading. Chen and co-authors (2022) fed their models the detailed line items of company filings, far more than the summary ratios used here. Van Binsbergen, Han and Lopez-Lira (2021) used machine-learning forecasts as a benchmark for measuring where analysts go wrong. Cao and You (2021) and Chattopadhyay, Fang and Mohanram (2022) worked on far larger samples, in the second case across countries, where this test had 44 companies. Cui, Xu and Zhou (2020), who compared their model with the consensus, presented it as a tool to help analysts, not replace them. Cao and co-authors (2024) found the strongest performer was neither the human nor the machine but the two together. And the machines are not free of the analysts' faults: Frank, Gao and Yang (2025) show that machine-learning forecasts fail the same efficiency tests used to convict analysts of bias. In each case the result turns on what the model is given to read, not on the algorithm alone.

7. What this test does not show

Read the result with these limits

The sample is small and favours the analysts. Forty-four large companies with dense coverage is where the consensus is strongest. Small and mid caps, where two or three analysts follow a stock, are where a model has the most room, and they are not in this test.

The contest is not symmetrical on timing. The models forecast from the previous quarter's data. A consensus figure can absorb guidance and news released during the quarter itself. That is the analysts' real advantage, but it means the test compares information sets as much as methods.

Two models are not "AI". Random Forest and XGBoost work on tables of numbers. Models that read earnings-call transcripts and filings, neural networks and sector-specific models were not tested and could give a different answer.

One crisis, one cycle. The Covid period supplies 81 forecasts. Ten years of data cover a single shock and a single tightening cycle.

8. Le Détroit's reading

The useful finding is not that humans beat machines. It is that a model fed only public accounting data reproduces what the market already knows and stops there. That is the efficient-markets argument (Fama, 1970) applied to forecasting: public information is already in the consensus. Anyone promising to replace an equity research desk with off-the-shelf algorithms and a fundamentals feed is selling a moving average.

The question for banks and asset managers is therefore one of inputs, not of algorithms. The gap measured here, 41 cents a share on average, is roughly the value of everything analysts learn that is not in a spreadsheet: guidance, tone, order books, regulators. Closing it means giving models that material, which is what the newer text-based systems attempt, and it is where the evidence still has to be built.

Until then the sensible use of these models is the modest one. A forecast that leans on the last four quarters is a cheap sanity check: where the consensus sits far from it, there should be a reason an analyst can name. On this sample the model is a second opinion and the analyst remains the forecaster.

What to watch

  • Text as an input. Whether models that read earnings calls and filings close the gap on the same companies, under the same walk-forward protocol.
  • Thinly covered stocks. The same test on small and mid caps, where the consensus is built from a handful of estimates and is easier to beat.
  • Combination. Whether blending a model's forecast with the consensus beats the consensus alone, the "man plus machine" result reported elsewhere.
  • The next shock. Covid is one episode. A second out-of-regime period would show whether the models' crisis penalty is structural.

This article is based on the author's own research: Berkan Tezgel, "Machine learning et prévision des bénéfices : comparaison avec le consensus des analystes financiers", master's thesis, MSc 2 Corporate Finance and Financial Engineering, INSEEC, 2025-26. All figures come from that study unless stated; calculations labelled as Le Détroit's are derived from its tables. Results apply to the 44 companies and the period studied and should not be extended to the whole S&P 500 or to other markets. This article is not investment advice.