Chest-pain labels in UCI Heart Disease data are reversed, preprint finds

A widely used medical benchmark has described its chest-pain codes backwards since at least 1990. Accuracy scores hardly change, but explanations built on the labels and language models that read them are misled.

6 min readIIIOpen sourcePreprint, not peer reviewed
Save
This studio still life photograph shows a row of four small wooden drawers in a cabinet on a paper background, with the first and last drawers' tags crossed over by their strings, and a single blue glass bead inside the open fourth drawer.AI illustration
Illustration: AI generated

What the study shows

The UCI Heart Disease data hold records of patients from four hospitals in the 1980s: Cleveland, Budapest, Switzerland and Long Beach. They are one of the most common teaching and benchmarking datasets in machine learning. One column records chest-pain type in four codes. The official documentation says code 1 means typical angina, the classic chest pain of heart disease, and code 4 means no chest pain.

The author reports that the codes are stored in reverse. Code 4 marks typical angina and code 1 marks patients with no chest pain. The two middle codes swap as well. Under the documented labels, the data seem to say that people without chest pain are the most likely to have heart disease, which contradicts long-settled cardiology.

For Cleveland, the author compares the file with the original 1986 study of the same 303 patients. The study's chest-pain table matches the file in 15 of 16 cells under the corrected reading, and in none under the documented one. Refitting the study's published risk model reproduces its numbers only with the corrected codes. With the codes as stored, the chest-pain effect flips sign.

For the other three hospitals, the raw records list the three textbook features of typical angina: pain behind the breastbone, pain brought on by exertion and pain eased by rest. About 93 to 96% of patients coded 4 have all three. Patients coded 1 almost never have any. A word-labelled Cleveland file from March 1990 already uses the documented labels, so the error is at least that old.

The author checked popular copies on OpenML, PMLB and Kaggle. Every copy that names the categories uses the reversed labels. Two named Kaggle copies alone account for about 400,000 downloads.

The author then sampled 150 papers from one Google Scholar search for studies using SHAP, a common method for showing which inputs drive a model's prediction. Of 124 readable papers, 32 stated a direction for a named chest-pain category. In 25 of these, about four in five, the direction contradicts the corrected categories. Nine papers offered a medical explanation for the backwards result. None noticed the reversal.

Standard models barely change when the labels are fixed, because swapping category names does not change the patterns in the numbers. But three small open-weight language models, Qwen2.5-7B, Llama-3.1-8B and Phi-3.5-mini, were asked zero-shot (without examples) whether a patient had heart disease. Given only age, sex and chest-pain type, they ranked patients clearly better with the corrected labels. With the documented labels, Qwen did no better than chance. The study is a preprint and has not been peer reviewed.

Our reading

In our reading, the evidence for the reversal itself is strong. Two independent checks point the same way: the original study's tables and model for Cleveland, and the raw symptom records for the other three sites. Reproducing published regression coefficients to two decimals only under one specific mapping is hard to explain any other way.

The more useful lesson is about why nobody caught it. Accuracy, the number most benchmarks report, is blind to what a category is called. A model that learns 'code 4 means higher risk' is right whatever the documentation says. The error only shows when someone attaches meaning to the codes, which is exactly what explanation tools like SHAP invite people to do.

That gives a concrete case of a failure that a single accuracy score hides. A team could build a heart-risk model on a Kaggle copy, score well, then present a SHAP chart to clinicians saying that patients without chest pain are at highest risk. The model would be fine. The explanation would be wrong, and the paper suggests some authors have defended such results as clinically plausible.

Free membership

Read the rest of this story

Membership is free. You get every article in full, and can save stories and follow topics.

We send a sign-in link, no password needed. Already a member? Sign in

Readiness assessment

III
Open source
LevelStatusEvidence
I  Lab onlyMetThe reversal is established through reanalysis of the UCI files against the original 1986 study and the raw records.
II  BenchmarkedMetThe paper reports results on the public UCI Heart Disease benchmark: AUC for conventional models, and AUC with confidence intervals for three open-weight language models under documented versus corrected labels.
III  Open sourceMetEvidence files, scripts, the literature-audit coding and the LLM-probe notebook are released at github.com/tpattabhi/anginaflip. An earlier version is archived on Zenodo.
IV  In productionNot yetThe paper documents no named organisation using the correction. UCI, OpenML, PMLB and Kaggle maintainers have not been shown to adopt it.

What would move it up
Level IV would need documented adoption, for example the UCI repository, OpenML, PMLB or major Kaggle maintainers correcting the chest-pain labels, or named groups re-running analyses with the corrected mapping. Independent confirmation, the planned second coding of the audit and the Hungarian replication would also strengthen the case.

The study

Tejas Tovinkere Pattabhi. Typical Angina, Reversed: A Long-Standing Documentation Error in the UCI Heart Disease Data. arXiv, 24 November 2026. Read the paper

Preprint, not peer reviewed · Licence CC BY 4.0 · University of the Cumberlands, Williamsburg

Notes

  1. Pattabhi, T. T. Typical Angina, Reversed: A Long-Standing Documentation Error in the UCI Heart Disease Data. Preprint, version 8, 24 November 2026. Not peer reviewed. Source
  2. Code, evidence files, literature-audit coding and LLM-probe notebook. Source
  3. Earlier version (18 Nov 2026), archived on Zenodo. Source
  4. Cleveland check: original study's Table 1 matches in 15 of 16 cells with corrected coding (5 minus cp), 0 of 16 with documented coding. Three-predictor model: published constant -2.29 and pain -1.10; refit with cp as stored gives -7.77 and +1.10.
  5. Literature audit: 269 Scholar records, 230 eligible, 150 sampled (seed 20261117), 124 readable, 32 direction-stating. 25 of 32 inconsistent (78%; 95% CI 61 to 89%); 22 of 32 attributable to documentation (69%; 51 to 82%; post hoc); 9 rationalised clinically.
  6. LLM probe, minimal template (age, sex, chest pain): AUC gain with corrected labels of +0.331 (Qwen2.5-7B), +0.238 (Llama-3.1-8B), +0.122 (Phi-3.5-mini). Qwen AUC 0.458 with documented labels. Full template: +0.016, +0.077, +0.002.

Edited and signed by

Stefan PerdalFounder. Twenty-five years of building digital products.168 stories edited

Stefan read the study, set the readiness level and approved this story. An AI system found the paper and wrote the first draft.

How this was made

An AI model read the study and wrote this article in the structure Science Underway uses. An editor reviewed it and approved it for publication. Check the original study before you rely on the details.

More on Safety & evaluation