Guides, manuals and platform references.
Published November 26, 2026 · View Markdown
Two return-forecasting models can trade places on a leaderboard without changing a single prediction. Change the error metric, and you change how much a large miss matters. MAE treats error magnitude linearly; RMSE squares errors before averaging and taking the square root.
For an automated trading model, this is a choice about forecast evaluation, not a verdict on profit. If the eventual decisions use an AlgoWay workflow, keep the alert-to-order process separate from the forecast score. Sending a trade successfully does not establish that the prediction behind it was useful.
Assume the model predicts the next bar’s return in percentage points. A forecast of 0.20% against a realized return of 0.10% has an error of 0.10 percentage points, or 10 basis points. This is an absolute difference between returns, not a 10% relative forecast error.
For one target with equal observation weights, let each error be predicted return minus realized return:
MAE and RMSE have the target’s units. MSE has squared units. The scikit-learn regression-metric guide documents these definitions. Fix the return convention, forecast horizon and units before comparing results. A decimal return of 0.001 and a percentage-point return of 0.10 describe the same move but produce numerically different error scores.
The following is constructed arithmetic, not a backtest or a model trial. Suppose three models produce these absolute forecast errors on the same four observations, measured in basis points:
| Model | Absolute errors | MAE | RMSE |
|---|---|---|---|
| A | 10, 10, 10, 10 | 10 | 10 |
| B | 0, 0, 0, 40 | 10 | 20 |
| C | 0, 0, 0, 32 | 8 | 16 |
For B, MAE is 40 / 4 = 10. RMSE is the square root of (1600 / 4), which is 20. A and B tie under MAE, but RMSE distinguishes four modest misses from one concentrated miss.
C makes the ranking reversal explicit. Its MAE of 8 beats A’s 10, while its RMSE of 16 loses to A’s 10. Neither calculation is broken. The metrics value the distribution of errors differently.
For the same single-target observations and nonnegative weights, RMSE cannot be below MAE. Equality occurs when the absolute errors with positive weight are all the same. This is a useful arithmetic check, not a rule for comparing scores calculated on different samples.
Both metrics discard the sign of an individual error through an absolute value or a square. They do not directly measure whether a forecast chose the correct trade direction.
Consider an actual next-bar return of +5 basis points. Forecast X is -1, giving an absolute error of 6. Forecast Y is +15, giving an absolute error of 10. X is closer numerically but has the wrong sign. Under a simple policy that trades the sign of every forecast, Y selects the correct direction in this observation. That still says nothing about costs, entry timing or the results of the remaining trades.
Likewise, a large forecast miss need not be a large account loss. Position size, whether a trade was taken, and the exit rule sit between prediction and profit. RMSE is sensitive to large residuals; it is not a drawdown measure or a direct estimate of tail losses in an account.
Scikit-learn’s mean_absolute_error and root_mean_squared_error accept sample weights and multi-output aggregation choices. Record those settings. Giving volatile observations extra weight changes the question being scored; averaging targets with different scales can make the larger-scale target dominate.
For the scalar example above, evaluate each model on exactly the same timestamped targets. Use a common missing-prediction policy and show how many observations were excluded. Otherwise a model may appear accurate because its difficult predictions quietly disappeared from the comparison.
The existing chronological model-validation guide covers how to separate training and later evaluation. This article addresses what to measure after those predictions exist. Include a simple reference forecast, such as zero next-bar return, on those same observations so that an isolated number has something to beat.
Use MAE when proportional penalties for forecast misses match the research question. Use RMSE when larger misses should receive more weight, and inspect the individual residuals that drive it. Reporting both makes the tradeoff visible; selecting whichever flatters the winning model conceals it.
In scikit-learn model selection, names such as neg_mean_absolute_error and neg_root_mean_squared_error reverse the loss sign so that higher scores remain better. A score of -8 beats -10 for negative MAE; the corresponding reported errors are 8 and 10. This scoring convention is documented in the model-evaluation guide.
Keep the forecast report beside a separate evaluation of the actual trading policy, including costs and exposure. The report should state the horizon, units, evaluation dates, weights, baseline and residual pattern. A leaderboard becomes useful when its winner comes with an explanation of what “better” means.