Comparisons

Pairs that get conflated in real metric reviews and real design docs — batch and online, precision and recall, data drift and concept drift, validation and test. Neither column wins; what decides is the problem. Each record leads with the confusion, because the confusion is the reason the record exists.

MAE vs RMSE

What people get wrong about this pair

They are reported interchangeably as "the error", and models are compared on whichever looks better. RMSE is always at least MAE, and the gap between them is itself a diagnostic: a large gap means a few big misses, a small gap means errors of similar size. Choosing one is choosing a cost function — squared error says a miss of ten is a hundred times worse than a miss of one, absolute error says ten times — and the model that minimises one is not the model that minimises the other: the squared-error optimum is the conditional mean, the absolute-error optimum is the conditional median, which differ whenever the target is skewed. The strongest form of the MAE side is that it says what the business asked — "how far off are we, typically" — and that it is robust to the outliers that are usually data errors anyway. The strongest form of the RMSE side is that the real costs often are convex, that it is the natural companion to a squared loss, and that a metric which ignores the big misses hides the ones that cause incidents. Pick from the shape of the cost, report both, and explain the gap.

MAE — mean absolute error; every unit of error costs the same
Use it when

When the cost of being wrong is linear in the error — an hour late costs an hour — when the target has outliers you do not want to dominate the metric, and when the number must be explained in the target's units.

RMSE — root mean squared error; large errors cost disproportionately more
Use it when

When one large miss is much worse than several small ones — a capacity forecast that leaves a warehouse empty, a dose — and when you are training a model whose loss is squared error and want the metric to agree with it.

DimensionMAE — mean absolute error; every unit of error costs the sameRMSE — root mean squared error; large errors cost disproportionately more
Penalises large errorsLinearlyQuadratically
Optimal predictorConditional medianConditional mean
OutliersBounded influenceDominate
UnitsTarget unitsTarget units, but not an average error
Skewed targetsFollows the typical casePulled toward the tail
Companion training lossAbsolute / HuberSquared error
The gap between themLarge gap ⇒ a few big misses

Model families compared

Linear, trees, boosting, neural and k-NN — compared without naming a winner, and with the block that says where the comparison stops being true.

CONTESTED

No column is a winner. Each family is a set of assumptions about the data — linear separability, axis-aligned interactions, additive residuals, a representation that can be learned, locality in feature space — and the right one is the one whose assumptions your data happens to satisfy at the size you have. The reflex answer “XGBoost” is the red flag this table exists to catch: it is often right on tabular data and it is never right as a reflex, because it skips the baseline that would have told you whether anything more than a linear model was needed. The where this comparison misleads block on every row is the part worth reading.

Data size needed
Linear
Small. A few hundred rows estimate a handful of coefficients well; regularisation lets it survive more features than rows.
Trees
Moderate. A single tree is unstable on small data; a forest averages the instability away from a few thousand rows.
Boosting
Moderate to large. Needs a validation fold for early stopping on top of the training rows, and tunes badly on small data.
Neural
Large from scratch — orders of magnitude more than the others. Small if a pretrained network provides the representation.
k-NN
Small to moderate. Every stored example is the model; too few leaves gaps, too many makes prediction slow.
Where this comparison misleads

Count independent entities, not rows — a million events from ten thousand users is ten-thousand-sized data for generalising to new users. And the neural column flips completely with transfer learning: a pretrained model fine-tuned on two thousand images beats every other column on that task.

Tabular data
Linear
A strong baseline and often the final model when interactions are few or engineered by hand.
Trees
Strong without feature engineering; handles mixed types, thresholds and interactions natively.
Boosting
Usually the highest-quality single model on tabular data with a tuning budget and enough rows.
Neural
Competitive only with careful architecture and preprocessing; rarely worth it below hundreds of thousands of rows.
k-NN
Weak beyond a few dimensions and sensitive to scaling; fine as a baseline.
Where this comparison misleads

The "boosting wins on tabular" claim is true for a tuned model on tens of thousands of clean rows with a validation set. It is not true for three hundred rows, for a problem whose signal is linear, for a regulator who wants coefficients, or for a team with no time to tune — and the gap to the linear model is often inside the error bar.

Text, images, audio
Linear
Strong on bag-of-words text; useless on raw pixels or waveforms without a learned representation in front of it.
Trees
Cannot learn from raw pixels or tokens; usable on top of embeddings.
Boosting
Same as trees — a ranker or classifier on top of extracted features, not a feature learner.
Neural
The only family that learns the representation; pretrained networks make it the default for these modalities.
k-NN
Reasonable on top of pretrained embeddings with a good distance; useless on raw inputs.
Where this comparison misleads

The columns are not competing on the same input. Once a pretrained network has produced an embedding, a linear model or k-NN on top of it is often within a few points of full fine-tuning — so "neural for images" usually means "a neural representation, then whichever head is cheapest".

Interpretability
Linear
Coefficients are the model; sign, magnitude and confidence intervals can be shown and defended.
Trees
A shallow tree is a readable flowchart; a forest of five hundred deep trees is not.
Boosting
Opaque; importance and SHAP-style attributions are approximate and describe the model, not the world.
Neural
Opaque; attribution methods exist and disagree with each other.
k-NN
Transparent by example — "these five similar cases were positive" — which is sometimes exactly what a reviewer wants.
Where this comparison misleads

Interpretability is not one property. A linear model with two hundred correlated features and L1 selection is harder to explain honestly than a depth-three tree; and every column's "explanation" is undermined equally by a leaked or proxy feature, which the explanation will present with confidence.

Training cost
Linear
Seconds to minutes on a CPU, even for millions of rows.
Trees
Minutes; embarrassingly parallel across trees.
Boosting
Minutes to hours; sequential across rounds, plus a tuning search on top.
Neural
Minutes for a small head on a CPU; hours to weeks on accelerators for anything trained end to end.
k-NN
None — the training step is storing the data. The cost is deferred to prediction time.
Where this comparison misleads

Training cost is dominated by the number of runs, not the run: a boosted model tuned over two hundred configurations costs more than a network fine-tuned once. And the k-NN column's zero is a loan repaid on every query.

Inference latency
Linear
Microseconds; a dot product.
Trees
Fast per tree; hundreds of deep trees add up but stay well under a millisecond on a CPU.
Boosting
Similar to a forest; thousands of shallow trees is still sub-millisecond compiled.
Neural
From sub-millisecond for a small network to tens of milliseconds for a transformer; batching and hardware decide the cost.
k-NN
Grows with the stored set; needs an approximate index at scale, which trades recall for speed.
Where this comparison misleads

The model is rarely the slow part. Feature retrieval, a network hop and JSON serialisation usually dwarf any of these numbers, so a latency budget is a question about the serving path before it is a question about the family.

Feature engineering burden
Linear
High. Interactions, nonlinearities, bucketing and scaling must all be built by hand.
Trees
Low. Thresholds and interactions are learnt; scaling is irrelevant; categories need only a sensible encoding.
Boosting
Low, as for trees — but the features still have to be computed identically at serving time.
Neural
Low for raw modalities, where the network learns the features; high on tabular data, where scaling, encoding and architecture all matter.
k-NN
High. The distance is the model, so scaling and feature weighting decide everything.
Where this comparison misleads

A low burden on the modelling side does not remove the burden on the serving side: every column's features must be reproduced at prediction time with the same code, the same freshness and the same point-in-time semantics. Trees remove the need to engineer features, not the need to serve them.

Handling of missing values
Linear
Must be imputed, and the imputation is part of the model that ships.
Trees
Most implementations route missing values natively, learning which branch they belong to.
Boosting
Native handling in the common implementations; missingness becomes a signal.
Neural
Must be imputed or masked explicitly; the network will not do it for you.
k-NN
Must be imputed; a missing coordinate breaks the distance.
Where this comparison misleads

Native handling is convenient and dangerous in equal measure: it lets a tree model learn that "missing" predicts the target, which is fine until serving produces missingness for a different reason — a timeout, a new form — and the model reads the outage as a signal.

Calibration of outputs
Linear
Logistic regression is close to calibrated by construction, given the model fits.
Trees
Forest vote fractions are compressed toward the middle; not probabilities without calibration.
Boosting
Scores rank well and are typically miscalibrated, especially with class weighting or early stopping.
Neural
Often overconfident; calibration degrades with model size and with distribution shift.
k-NN
Neighbour vote fractions are coarse and depend on k; treat as ranks.
Where this comparison misleads

Calibration only matters if a downstream decision multiplies the score by a cost or compares it to a probability threshold; a pure ranker does not need it. And calibration measured on the validation set drifts with the base rate in production, for every column alike.

Extrapolation
Linear
Extrapolates linearly beyond the training range — confidently, and often wrongly.
Trees
Cannot extrapolate: a prediction outside the training range is the nearest leaf's value.
Boosting
Same as trees — flat beyond the range it saw.
Neural
Unpredictable outside the training distribution; may extrapolate smoothly or produce nonsense.
k-NN
Cannot extrapolate; returns the nearest stored examples.
Where this comparison misleads

Neither behaviour is "correct". A tree that predicts last year's maximum for a record-breaking day is wrong; a linear model that predicts a negative price is wrong differently. The honest answer is a monitor on inputs outside the training range and a fallback for them, whichever family serves.

Robustness to irrelevant features
Linear
Moderate with regularisation; a noisy feature gets a small coefficient, not zero, unless L1 is used.
Trees
Good; an uninformative feature is rarely chosen for a split.
Boosting
Good, with the same caveat — and it will find a weakly leaky feature faster than anything.
Neural
Poor without regularisation on small data; will use anything correlated with the target.
k-NN
Very poor; every irrelevant dimension dilutes the distance equally.
Where this comparison misleads

Irrelevant is not the danger — leaky is. Every column will seize a feature that carries the answer, and the more capable the model the more efficiently it does so; robustness to noise says nothing about robustness to leakage, which only a point-in-time audit provides.

When it is the wrong choice
Linear
When the signal is in interactions and thresholds nobody has engineered, or in raw pixels and tokens.
Trees
When the target extrapolates, when the data is tiny, or when a coefficient has to be defended.
Boosting
When there is no validation set to stop on, no time to tune, tiny data, or a regulator in the room. "XGBoost" as a reflex is the red flag, not the answer.
Neural
When the data is small tabular, when latency is a millisecond on a CPU, or when nobody can operate the training and serving infrastructure it needs.
k-NN
When the data is high-dimensional and unscaled, when the stored set is large, or when prediction latency matters.
Where this comparison misleads

Every column is wrong somewhere, and the question that finds where is the same for all of them: how much data, of what modality, at what latency, with what interpretability requirement, judged by which metric, at what cost to train and serve. A model family chosen before those are answered is a guess with a library name.