# 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.

- Category: Safety & evaluation
- Readiness level: III (Open source) on Science Underway's four-step scale, as proposed
- Published: 2026-11-27
- Editor: Stefan Perdal
- URL: https://scienceunderway.com/articles/chest-pain-labels-in-uci-heart-disease-data-are-reversed-preprint-finds

## The study

Typical Angina, Reversed: A Long-Standing Documentation Error in the UCI Heart Disease Data (preprint, not peer reviewed). arXiv 2611.33248. https://arxiv.org/abs/2611.33248

## At a glance

- What it shows: In a well-known heart disease dataset used to teach and test AI, the patients recorded as having no chest pain actually had classic heart-related chest pain, and the reverse. Many published papers have reported the backwards pattern as a medical finding.
- What it does not show: It does not show that published accuracy results on this dataset are wrong, because standard models score almost the same either way. It also does not measure how common the mistake is across all research.
- Why it matters: Explaining what a model has learned is now routine, and wrong labels make those explanations wrong while the accuracy score looks fine. AI systems that read the label words, such as language models, are directly affected.

## 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.

The rest of the article (what it means, limits, what to watch) is free for members: https://scienceunderway.com/articles/chest-pain-labels-in-uci-heart-disease-data-are-reversed-preprint-finds

## 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.

---
Source: Science Underway, https://scienceunderway.com/. Please link to the article when you cite it.
