Backwards Since 1990: AI's Most Famous Heart Dataset Has Its Labels Swapped
In the UCI Heart Disease dataset, which generations of ML students have practiced on, “asymptomatic” apparently means typical angina, and vice versa. That would explain a paradox countless tutorials have puzzled over. Classic models don't care about the error. Language models, however, read the words and get led astray.

What this is about
If you're learning machine learning, sooner or later you'll run into it: the UCI Heart Disease dataset. It covers 303 patients from the Cleveland Clinic, plus data from Budapest, Zurich/Basel and Long Beach. The goal is to predict whether a cardiac catheterization shows coronary artery disease, meaning narrowed coronary arteries. The dataset's page on the UCI Machine Learning Repository has around 1.26 million views, plus hundreds of thousands of downloads of its copies.
A preprint from November 24, 2026 now claims that a key column has been documented backwards since at least 1990. The column in question is “cp” (chest pain type). Where it says “asymptomatic,” meaning “no symptoms,” the patients actually have typical angina pectoris. That's the classic heart pain that comes on with exertion and eases at rest. Conversely, “typical angina” stands for patients without chest pain. The paper was written by Tejas Tovinkere Pattabhi of the University of the Cumberlands (Kentucky) as sole author. It hasn't been peer-reviewed. The author says he used Anthropic's Claude for code and editing.
We looked at the evidence and, where possible, checked it against the original files.
The paradox everyone explained away
Anyone who analyzes the dataset quickly spots something odd: of all groups, the “asymptomatic” one has the most disease. Tutorials like to explain this clinically. The e-learning provider Scaler writes that type 4 (asymptomatic) is
“paradoxically the highest-risk category,”
because silent heart disease is often only detected during screening. A student project at the NYC Data Science Academy invokes “silent ischemia,” i.e. reduced blood flow without pain. A paper by Shakerin and Gupta presented at the logic programming conference ICLP 2020 calls type 4 chest pain “a serious sign of heart disease.”
The explanation sounds plausible, because silent ischemia really does exist. But read the codes the corrected way, and the paradox disappears. We recalculated the well-known Cleveland numbers:
| Stored code | Per documentation | Patients | Of whom diseased | Corrected meaning |
|---|---|---|---|---|
| 1 | typical angina | 23 | 7 (30%) | asymptomatic |
| 2 | atypical angina | 50 | 9 (18%) | non-anginal pain |
| 3 | non-anginal pain | 86 | 18 (21%) | atypical angina |
| 4 | asymptomatic | 144 | 105 (73%) | typical angina |
With the corrected labels, typical angina has the highest disease rate at 73 percent. That's exactly what you'd expect in patients referred for catheterization. The rule: the correct name for code k is the documented name of 5 − k.
The evidence: what the paper says and what we checked ourselves
First, the original study. Pattabhi compares the data with Detrano et al. 1986 (Circulation 73:970). The vessel counts (55, 36, 35, 13), which according to the paper match exactly, show that the Cleveland file belongs to this study. In the chest pain table broken down by sex and disease status, the documented reading matches 0 of 16 cells, the corrected one 15 of 16. According to the paper, the last cell (27 percent of 34) doesn't correspond to a whole number of patients. The original study's regression model, with a pain coefficient of −1.10, can also only be reproduced with 5 − cp. With the stored codes, the sign flips to +1.10. We couldn't access the original article ourselves; it's paywalled. One distinction is important: the frequently cited Detrano paper in the American Journal of Cardiology 64:304 dates from 1989 and is the dataset's introductory paper, not the source of the comparison table.
Second, the raw data. This is the strongest evidence, because you can check it without any journal articles. Besides “cp,” the full UCI files contain three individual features: substernal pain (“painloc”), pain provoked by exertion (“painexer”), and relief at rest (“relrest”). These are exactly the three criteria of the classic classification used, for example, by the UK's NICE guideline. If all three apply, it's typical angina; two means atypical angina; one or none means non-anginal pain. According to the paper, 96 percent of code 4 patients in Budapest (118 of 123) have all three features, 93 percent in Switzerland (91 of 98), and 96 percent in Long Beach (126 of 131).
We read out the first 8 records of the Budapest raw file and the first 12 of the Long Beach raw file from the UCI site ourselves. All seven patients with code 4 had all three angina features. Overall, the corrected reading fit 17 of 20 records, the documented one only 3. That's a small sample, not statistics. But it shows that the core of the claim can be verified against the public files. For the middle codes 2 and 3, the picture is less clear: three patients with code 3 had only one feature. For Cleveland itself, these fields are missing. A WARNING file from former maintainer David Aha notes that the raw file is corrupted.
Third, the age of the error. The file “cleve.mod” bears the name John Gennari and the date 3/13/90 in its header. It translates the codes into words, and there, 4 is already listed as “asympt.” We checked this in the file on the UCI site.
Where the wrong labels live today
| Copy | Documentation | Reach (per paper) |
|---|---|---|
| UCI Repository | 1 = typical angina, 4 = asymptomatic | approx. 1.26M views |
| Statlog (Heart), 270 patients | same codes | – |
| OpenML heart-c / heart-h | word labels as in UCI (checked ourselves for heart-c) | – |
| PMLB | shifted by 1, 0 = typical angina | – |
| Kaggle fedesoriano (918 rows) | “TA” = UCI code 1 | approx. 290,000 downloads |
| Kaggle redwankarimsony (920 rows) | words, wrong | approx. 112,000 downloads |
| Kaggle Lapp/johnsmith88 (1,025 rows) | end codes swapped, target column flipped | approx. 386,000 downloads |
The Lapp copy on Kaggle shows how such errors take on a life of their own. According to the paper, the two outer codes there are actually correct under the usual reading, but the target variable is flipped. The copy also contains only 302 distinct patients. In 2020, data analyst Tyler Burleigh, with help from the Kaggle community, discovered the flipped target column. But he “fixed” the chest pain codes according to the UCI documentation, setting them back to “0 = asymptomatic.”
Pattabhi also analyzed a random sample of 150 Google Scholar hits on SHAP analyses of the dataset. SHAP is a method that shows how strongly each feature influences a prediction. 124 papers were readable. 32 of them state a direction for a named chest pain category, and 25 of those 32 (78 percent) contradict the corrected interpretation. Nine offer a clinical rationale for the wrong finding. None notices the error. The author concedes that he did all the coding himself and that the category “attributable to the documentation error” (22 papers) was only defined after the fact.
Why classic models don't notice, but language models do
Logistic regression and random forests only see numbers. Whether 4 is called “asymptomatic” or “typical angina” makes no difference to them. According to the paper, the AUC of a logistic regression is 0.903 vs. 0.911. AUC measures how well a model separates sick from healthy patients: 0.5 is a coin toss, 1.0 would be perfect. For random forests and gradient boosting, it differs by at most 0.002. That likely explains why nobody noticed the error for 36 years. Only the interpretation goes wrong. With one-hot encoding, each category gets its own yes/no column. The largest chest pain coefficient (+0.48) then goes to the column named “asymptomatic,” while the “typical angina” column sits at −0.25.
Language models, on the other hand, read the words and bring medical prior knowledge with them. Pattabhi tested three open models in 4-bit quantization zero-shot, meaning without any training examples. He measured the probability of “Yes” in response to a question about coronary artery disease, using the 303 Cleveland patients:
| Model | Input | AUC documented labels | AUC corrected | Difference |
|---|---|---|---|---|
| Qwen2.5-7B | all 13 features | 0.844 | 0.861 | +0.016 |
| Qwen2.5-7B | age, sex, chest pain only | 0.458 | 0.789 | +0.331 |
| Llama-3.1-8B | all 13 features | 0.512 | 0.589 | +0.077 |
| Llama-3.1-8B | age, sex, chest pain only | 0.542 | 0.779 | +0.238 |
| Phi-3.5-mini | all 13 features | 0.855 | 0.856 | +0.002 |
| Phi-3.5-mini | age, sex, chest pain only | 0.673 | 0.795 | +0.122 |
So the often-quoted range of 0.12 to 0.33 applies only to the minimal input. With all features, the effect shrinks to 0.002 to 0.077, because other values compensate for the wrong word. Qwen's 0.458 with the wrong labels stands out: that's worse than guessing, meaning the model consistently reasons backwards. The author names limitations himself. Only small models were tested, with a single prompt format, and only on the Cleveland site. Qwen and Phi almost never answered “Yes,” so the AUC differences rest on tiny probabilities. A planned replication with the Budapest data and larger models didn't happen.
That this isn't just a lab problem becomes clear from the code of TabLLM (Hegselmann et al., AISTATS 2023), one of the best-known approaches for feeding tables to language models as text. The benchmark uses fedesoriano's Kaggle copy and writes the chest pain type into the prompt in plain text: “TA” becomes “typical angina,” “ASY” becomes “asymptomatic.” If the paper is right, the models there are fed the swapped words. Whether that noticeably changes TabLLM's published results is an open question. TabLLM fine-tuned on examples, which can partly absorb the error. The table question-answering benchmark DataBench from the Cardiff NLP group also includes this Kaggle copy.
What's still open
We found no statement from UCI, OpenML or Kaggle. The paper also doesn't say whether the author contacted the maintainers. As of November 26, there was no discussion on Reddit or Hacker News. The GitHub repository anginaflip had zero stars when we checked, but contains scripts and tests meant to reproduce the key numbers. A second, independent coder for the literature review is still missing. An earlier version has been on Zenodo since November 18.
The bottom line
Our take: for a single-author preprint, the core finding is unusually well supported. The raw data contain the three features that define the category, and anyone can count them there. Our own sample backs up the claim. Clinically, the corrected reading is the obvious one: among patients referred for catheterization, typical angina should have the highest disease rate, not its absence. The assignment of the middle codes 2 and 3 is less certain, and the literature figure rests on one person's judgment.
The case recalls the work of Northcutt et al. 2021: they found an average of at least 3.3 percent wrong labels in the test sets of ten well-known benchmarks, and at least 6 percent in ImageNet, enough to flip model rankings. Kapoor and Narayanan described a related problem in 2023: by their count, data leakage affects 294 papers across 17 fields. But what's new here is something else. Until now, column names and category names were decoration that only humans read. Once language models read tables as text, these words become input data. Documentation errors that had no consequences for decades suddenly change predictions. If you test LLMs on tabular benchmarks, you should also check whether the labels are right. And if you teach with this dataset, you now have a better example than ever of how easy it is to explain away a result with plausible medicine instead of checking the data.
Sources
- arXiv: Typical Angina, Reversed (Abstract) arxiv.org
- arXiv: Typical Angina, Reversed (HTML-Volltext) arxiv.org
- GitHub: tpattabhi/anginaflip github.com
- Zenodo: Vorversion des Preprints zenodo.org
- UCI: heart-disease.names (Attributbeschreibung) archive.ics.uci.edu
- UCI: cleve.mod (Datei von 1990) archive.ics.uci.edu
- UCI: WARNING-Datei zur Cleveland-Rohdatei archive.ics.uci.edu
- UCI: Rohdatei Budapest (hungarian.data) archive.ics.uci.edu
- UCI: Rohdatei Long Beach (long-beach-va.data) archive.ics.uci.edu
- OpenML: heart-c (API-Beschreibung) openml.org
- Scaler: Heart Disease Prediction Tutorial scaler.com
- NYC Data Science Academy: Heart Disease Prediction nycdatascience.com
- Shakerin & Gupta: White-box Induction From SVM Models (ICLP 2020) ar5iv.labs.arxiv.org
- Tyler Burleigh: Blog zum Kaggle-Herzdatensatz (2020) tylerburleigh.com
- TabLLM (Hegselmann et al.) ar5iv.labs.arxiv.org
- GitHub: clinicalml/TabLLM github.com
- TabLLM: Variablen-Definitionen Heart raw.githubusercontent.com
- Hugging Face: cardiffnlp/databench Heart huggingface.co
- Patient.info: Stable angina (Definition typische Angina) patient.info
- Northcutt et al.: Pervasive Label Errors in Test Sets arxiv.org
- Kapoor & Narayanan: Leakage and the Reproducibility Crisis reproducible.cs.princeton.edu
Ask the AI assistant
Questions about this article, installation or background? Our assistant knows this page and runs on our own machine, not in someone else's cloud.
The Assistant is an AI (Gemma 4) and can make mistakes – please check important details against the source. Questions are used only to generate an answer and are deleted after one hour. Please don't enter any personal data.
Comments
What do you think? Already tried it? Write it here, no sign-up needed.
Comments are public. Links aren't allowed, and we delete abusive posts. You can delete your own comment at any time in this browser. Learn more in the Privacy Policy.