Skip to content
AI.info

How machines learn

Baselines and Sanity Checks

Use naive predictors, rules, small-sample tests, label shuffles, and ablations to detect broken pipelines and measure genuine learning progress.

By the end you can

Key idea

A high score can still lose to the current process

Epic's proprietary Sepsis Model is implemented at hundreds of US hospitals. The external validation at Michigan Medicine covered 27,697 patients and 38,455 hospitalizations, between 6 December 2018 and 20 October 2019. Sepsis occurred in 2,552 of those hospitalizations, 7% of them. The model's hospitalization-level area under the ROC curve was 0.63, with a 95% confidence interval from 0.62 to 0.64.

Wong and colleagues put the operational consequence in the Results section of their abstract, in JAMA Internal Medicine in June 2021: “The ESM also did not identify 1709 patients with sepsis (67%) despite generating alerts for an ESM score of 6 or higher for 6971 of all 38 455 hospitalized patients (18%), thus creating a large burden of alert fatigue.”

A second group reached the same place from a different hospital system. Ostermayer and colleagues validated the same Epic model across 145,885 encounters in two Harris County emergency departments, in Texas. Sensitivity in the 6-hour window was 14.7%. Their conclusion, in JAMIA Open in October 2024: “The ESPMv1 provides suboptimal diagnostic characteristics for undifferentiated patients in a county ED.”

None of those numbers were available to anyone reading a vendor score alone. A baseline gives performance context. It also helps reveal whether the metric, data, or task framing rewards trivial behavior. Sepsis was present in 7% of hospitalizations. A rule that predicts “no sepsis” for everybody therefore generates no alerts and misses every case, while getting the overwhelming majority of hospitalizations right. A system that misses 67% while alerting on 18% has to be compared against that rule, and against what the clinicians were already doing, before anyone can say what it is worth.

0.63 discrimination, 67% of cases missed, 18% of all hospitalizations alerted. A score without a baseline has no scale of difficulty.

Case

71 clinical studies, 282 comparisons, no measurable advantage

How much of a reported advantage survives an honest baseline can itself be measured. Christodoulou and colleagues searched Medline from January 2016 to August 2017. They were looking for studies that compared machine learning with logistic regression on binary clinical outcomes. They included 71 of 927 studies and extracted 282 head-to-head comparisons. The review appeared in the Journal of Clinical Epidemiology in June 2019.

Across the 145 comparisons at low risk of bias, the difference in logit(AUC) between the two approaches was 0.00. The 95% confidence interval ran from −0.18 to 0.18. Across the 137 at high risk of bias it was 0.34 in favour of machine learning, interval 0.20 to 0.47. Their conclusion: “We found no evidence of superior performance of ML over LR.” The advantage lived in the validation procedure, not in the model.

Figure

Machine learning beat logistic regression only in the studies at high risk of bias; where the validation was sound the difference was zero.

Visual

Four baselines answer four different questions

A project may need several baselines. Each tests a different assumption, and the historical-heuristic row is the one most often waved through.

Google Flu Trends is the case that settles it. The system over-predicted influenza-like illness in 100 of the 108 weeks from August 2011 to September 2013. It overshot the actual 2011-2012 level by more than 50%. Lazer, King and two colleagues reported the comparison in Science in March 2014: “Even 3-week-old CDC data do a better job of projecting current flu prevalence than GFT”. The baseline here is not a toy. It is last-known-value applied to official counts that were already three weeks stale, and it won.

An independent reassessment had reached the same verdict earlier. Olson and colleagues wrote in PLOS Computational Biology, in October 2013: “We identified substantial flaws in the original and updated GFT models at all three geographic scales, including completely missing the first wave of the 2009 influenza A/H1N1 pandemic, and greatly overestimating the intensity of the A/H3N2 epidemic during the 2012/2013 season.” A system can be celebrated, widely cited, and still be losing to the number a clerk could have written down.

FigureHierarchy · 4 levels
  • Constant predictor

    How hard is it to beat the label distribution or average target?

    • Historical heuristic

      Does the new approach beat a simple domain rule or last-known value?

      • Current workflow

        Does it improve the actual manual or software process in use?

        • Simple learned model

          Does added complexity beat a transparent, well-regularized model?

Example

Baselines should match the output and decision

A good baseline is simple but not careless — and in forecasting the simple ones have a documented record of winning.

Popular machine-learning methods were run against eight classical statistical methods on 1,045 monthly series from the M3 Competition. Makridakis and two colleagues published the result in PLOS ONE in March 2018. Their abstract records that “we found that the former are dominated across both accuracy measures used and for all forecasting horizons examined”. The results discussion adds the sentence that matters here: “Even Naive 2 (a seasonal Random Walk (RW) benchmark) is more accurate than half of the ML methods.”

Five years later the same shape appeared in deep learning. Zeng and colleagues found that one-layer linear models beat every Transformer-based long-term forecaster they tested: “Experimental results on nine real-life datasets show that LTSF-Linear surprisingly outperforms existing sophisticated Transformer-based LTSF models in all cases, and often by a large margin.” Two literatures, two decades, one lesson. The naive predictor is the control, not the courtesy.

  • Classification: predict the majority class, class prior, or a simple rule tied to a known risk factor.
  • Regression: use the training mean, median, seasonal average, or last observed value.
  • Ranking: preserve the current business order, sort by recency, or use popularity.
  • Forecasting: compare against persistence, seasonal naive, and recent moving averages — on the 1,045 monthly M3 series, Naive 2 was more accurate than half the machine-learning methods tested.
  • Generation: compare with templates, retrieval-only answers, or the current human drafting process.
  • Queue prioritization: measure first-come-first-served and the rule already used by operators.

Steps

Checks that should pass before expensive tuning

These tests move from pipeline integrity to evidence of real signal. What happens when a whole field skips them has been counted twice.

The AIX-COVNET collaboration searched bioRxiv, medRxiv, arXiv, EMBASE and MEDLINE for machine-learning models that diagnosed or prognosticated COVID-19 from chest radiographs and CT, between 1 January and 3 October 2020. They identified 2,212 studies; 415 survived initial screening, and 62 survived quality screening. Roberts and colleagues state the outcome in the abstract, in Nature Machine Intelligence in March 2021: “Our review finds that none of the models identified are of potential clinical use due to methodological flaws and/or underlying biases.” Sixty-two papers cleared a quality screen. Zero cleared use.

The parallel living review reached the same conclusion independently. Wynants and colleagues appraised 31 models in 27 studies, drawn from 2,696 screened titles, and wrote in the BMJ in April 2020 that “All models were rated at high or unclear risk of bias” and that “we do not recommend any of these reported prediction models to be used in current practice”. Every one of those models had a metric, and most had a good one. The ladder below is what would have been missing from them.

FigureProcess · 6 steps
  1. 1. Inspect raw examples

    Decode inputs, labels, and metadata as a person would see them.

  2. 2. Fit a tiny sample

    Confirm the implementation can memorize a handful of examples when capacity allows.

  3. 3. Compare a constant baseline

    Verify the metric rewards more than class frequency or target mean.

  4. 4. Shuffle labels

    Performance should collapse toward chance when input-target relationships are destroyed.

  5. 5. Remove suspicious features

    Ablate identifiers and post-event fields to test shortcut dependence.

  6. 6. Re-run a simple model

    Check whether complexity creates consistent held-out gains.

A label-shuffle test is powerful but not magical

Randomly permuting training labels breaks the relationship between inputs and targets. Many other properties of the dataset survive the permutation. A flexible model may still fit the shuffled training labels, but held-out performance should fall toward a no-signal level.

If it remains strong, investigate leakage, duplicate structure, evaluation code, or labels accidentally shared across partitions. The exact chance level depends on task and metric.

This is not folklore. It is a statistical test with a defined null distribution. Ojala and Garriga set out two permutation tests for classifier performance in the Journal of Machine Learning Research in 2010. Their abstract describes the first one — the wording, including “assess”, is as printed: “The first test assess whether the classifier has found a real class structure in the data; the corresponding null distribution is estimated by permuting the labels in the data.” scikit-learn implements exactly that test, as sklearn.model_selection.permutation_test_score. It reports the empirical p-value as (C + 1) / (n_permutations + 1), where C is the number of permutations whose score is greater than or equal to the true score. The formula has a consequence worth knowing before you run it. The best achievable p-value is 1/(n_permutations + 1), so the permutation count sets a floor no amount of signal can go below.

The shuffle became famous at ICLR in 2017, in a paper by Zhang, Bengio and three colleagues on why deep learning requires rethinking generalization. Their experiments “establish that state-of-the-art convolutional networks for image classification trained with stochastic gradient methods easily fit a random labeling of the training data”. That result “is qualitatively unaffected by explicit regularization, and occurs even if we replace the true images by completely unstructured random noise”. A training loss driven to zero therefore proves less than it looks. It is compatible with there being no relationship in the data at all. Only the held-out number carries the information you were after.

Comparison

Remove components to learn what actually contributes

Ablation turns a complex system into a set of testable claims. The clearest demonstration of what a feature ablation is for comes from chest radiographs.

Convolutional networks for pneumonia detection were trained on 158,323 chest radiographs from three hospital systems: 112,120 from NIH, 42,396 from Mount Sinai and 3,807 from Indiana University. One line in the abstract, by Zech and colleagues in PLOS Medicine in November 2018, says what those networks had available: “The prevalence of pneumonia was high enough at MSH (34.2%) relative to NIH and IU (1.2% and 1.0%) that merely sorting by hospital system achieved an AUC of 0.861 (95% CI 0.855–0.866) on the joint MSH–NIH dataset.”

Sorting by hospital is the shortcut baseline, and it scored 0.861. The networks could execute it. They identified the source hospital for 99.95% of NIH images, 22,050 of 22,062, and 99.98% of Mount Sinai images, 8,386 of 8,388. The best internal model scored AUC 0.931 and fell to 0.815 when tested externally. Remove the site signal and you learn how much of the 0.931 was pneumonia. Leave it in and you cannot tell.

The pattern repeated under pandemic conditions. DeGrave, Janizek and Lee reported in Nature Machine Intelligence that “we demonstrate that recent deep learning systems to detect COVID-19 from chest radiographs rely on confounding factors rather than medical pathology, creating an alarming situation in which the systems appear accurate, but fail when tested in new hospitals”.

FigureComparison · 3 columns

Feature ablation

Remove one feature group and measure slice-level changes.

  • Reveals shortcut dependence
  • Can expose redundant inputs
  • Must preserve valid preprocessing
  • Example: remove customer identifiers

Model ablation

Replace a complex component with a simpler one.

  • Tests architectural necessity
  • Clarifies cost-benefit trade-offs
  • May alter training dynamics
  • Example: linear model versus deep network

Workflow ablation

Remove retrieval, review, or a policy layer.

  • Measures system-level contribution
  • Can reveal hidden safety value
  • Requires careful offline simulation
  • Example: generation with and without evidence

Analogy

An analogy: calibrating a new instrument against reference tools

A laboratory has just bought a complex new instrument. Before trusting its novel readings, you test known samples and compare it with a simple reference method.

Baselines and sanity checks serve that role in machine learning. An instrument settles; a model keeps interacting with changing data and workflows, so its reference behavior needs periodic re-evaluation too.

Improvement size must be interpreted in the workflow

A one-point metric gain can be valuable when applied to millions of low-cost decisions, or irrelevant when it adds latency, review burden, and instability. The reverse also happens. A model that barely improves aggregate accuracy may substantially help a rare high-cost slice.

The Epic sepsis validation shows how much of the interpretation lives outside the metric. Alerts fired on 6,971 of 38,455 hospitalizations — 18% — while 1,709 sepsis patients, 67% of them, went unflagged. Neither figure is the AUC of 0.63, and no discussion of 0.63 alone would have surfaced either. Wong and colleagues named the cost in the same sentence as the counts: “thus creating a large burden of alert fatigue.”

Report absolute and relative changes, uncertainty, affected volumes, error trade-offs, and operational consequences. “Ten percent better” is incomplete unless the denominator and baseline are named.

Position

A comparison table is a fact about the study

Two approaches are compared, one wins, and the natural reading is that something has been learned about the two approaches. More often something has been learned about the comparison. That is a measured claim here rather than a cynical one. It has been measured by people who re-ran other researchers' comparisons from scratch.

Eighteen neural top-n recommendation algorithms had been published at top-level conferences. Ferrari Dacrema and two colleagues tried to reproduce them all, and their paper won best long paper at RecSys 2019. The abstract reports what they found: “Only 7 of them could be reproduced with reasonable effort. For these methods, it however turned out that 6 of them can often be outperformed with comparably simple heuristic methods, e.g., based on nearest-neighbor or graph-based techniques.” The seventh did not consistently beat a well-tuned non-neural linear ranking method. Eighteen published advantages; not one that survived a properly tuned simple baseline.

The neural collaborative filtering experiments were re-run independently at Google, and landed in the same place. Rendle and colleagues reported at RecSys 2020 that “we show that with a proper hyperparameter selection, a simple dot product substantially outperforms the proposed learned similarities”. The variable that decided those papers was not the architecture. It was how hard anyone tried on the other side of the table.

The same effect was measured in clinical prediction. Across the 145 comparisons Christodoulou and colleagues judged at low risk of bias, the difference in logit(AUC) was 0.00, interval −0.18 to 0.18. Across the 137 at high risk of bias it was 0.34 in favour of machine learning. Read the pair carefully. It does not say the newer methods cannot win. It says that in this literature the entire measured advantage sat in the comparisons whose design could not support it. Where the design held, no difference was detectable at all.

A baseline is therefore not a courtesy extended to the old approach before the real work starts. It is the instrument. Run it on the same split, at the same time, by the same person, on every slice that matters, and tune it as hard as you tune the model you hope will win. When the gap is small, report the gap and its uncertainty rather than two scores. Two numbers printed side by side invite a reader to subtract them and trust the answer.

Where the study design held, the advantage was 0.00. The whole of it sat in the comparisons that could not support it.

Example

Keep baselines alive throughout the project

Baselines belong in the evaluation suite. They should not disappear after the first experiment. Six of the seven reproducible neural recommenders lost to nearest-neighbour and graph-based heuristics only because somebody kept those heuristics available and tuned them properly, years after the original papers had moved on.

  • Version the exact rule, model, threshold, and preprocessing used by each baseline.
  • Run baselines on every new split and important slice.
  • Track whether drift changes the gap between the production model and simpler alternatives.
  • Revisit the current workflow when policy or staffing changes.
  • Require new complexity to justify latency, cost, maintenance, and risk — and tune the baseline as hard as the candidate before declaring a winner.
  • Retire baselines only when their purpose has been replaced by a documented stronger reference.

Key takeaways