Executive Summary
An analysis posted to arXiv says the chest pain codes in the UCI Heart Disease data, a fixture of machine learning textbooks and papers for decades, are numbered the wrong way round against their own documentation. The documentation calls code 1 typical angina and code 4 asymptomatic, and the patient records point the other way. The correct name for a stored code k, the analysis concludes, is the name the documentation prints at position 5−k.
The evidence is the patients' own symptom records. The raw files from Budapest, Switzerland and Long Beach carry the detail of the pain alongside the code, and among the patients marked 'asymptomatic (4)', who should have had no pain at all under the documented reading, 93 to 96 percent had all three marks of typical angina. Those three are pain behind the breastbone, pain that worsens with exertion, and pain that eases with rest. Cleveland, whose file holds no symptom detail, was checked a different way, by matching the table and the regression coefficients of the original 1986 clinical study.
Sections 1 through 5 follow what the paper states and what primary sources confirm. Section 6, which treats a data dictionary as something to be quality-checked, is this article's own reading.
Key Numbers
The first two show the grounds for calling the codes reversed and what follows from it. The last two show how far the error spread.
Source: Typical Angina, Reversed: A Long-Standing Documentation Error in the UCI Heart Disease Data (arXiv 2611.33248, submitted November 24, 2026).
93–96%
Marked 'asymptomatic' yet carrying every symptom
Budapest 118/123, Switzerland 91/98, Long Beach 126/131
25 of 32
Interpretation papers that named a direction and missed
78%, 95% confidence interval 61–89%. None of the 124 read caught it
0.458 → 0.789
AUC once the labels are corrected
Qwen2.5-7B given age, sex and chest pain only
~400,000
Downloads of copies carrying the wrong category names
Two Kaggle copies combined, 290,000 plus 112,000
All Four Codes Are Swapped
The UCI Heart Disease data is a public dataset posted in 1988 to the machine learning repository at the University of California, Irvine. It gathers patient records from four sites: the Cleveland Clinic, the Hungarian Institute of Cardiology in Budapest, Basel in Switzerland, and the Long Beach veterans hospital in the United States. Teaching material on heart disease prediction reaches for it almost by default, and the repository page alone has been viewed more than 1.26 million times. One of its thirteen variables is cp, which records the type of chest pain as a number from 1 to 4.
The analysis posted to arXiv on November 24 says those numbers mean the opposite of what the documentation says. It was written by Tejas Tovinkere Pattabhi of the University of the Cumberlands, working alone, and a note at the end states the work was carried out independently of his employer. The verification code and the hand-coded paper list are on GitHub. The rule is one line. The clinically correct name for a stored code k is the name the documentation prints at position 5−k. Codes 1 and 4 trade places, and so do 2 and 3.
| Stored code | Name in the documentation | Corrected name |
|---|---|---|
| 1 | Typical angina | Asymptomatic |
| 2 | Atypical angina | Non-anginal pain |
| 3 | Non-anginal pain | Atypical angina |
| 4 | Asymptomatic | Typical angina |
▲ The correct name for a stored code k is the documentation's 5−k. Source: arXiv 2611.33248
Typical angina is the most characteristic pain that appears when the vessels feeding the heart narrow. It sits behind the breastbone, it worsens with exertion, and it eases with rest. All three marks make it typical, two make it atypical, and one or none makes it non-anginal pain. Asymptomatic means there is no chest pain at all. So swapping 1 and 4 means the group in the sharpest pain and the group in no pain change places.
Derived datasets inherited the same codes. Statlog (Heart), which keeps 270 of the Cleveland patients, is one of them. The numbering is the same, so the error came along with it. Copies renumbered from 0 to 3 cannot take the rule directly, and the first step there is to find out which transformation was applied.
Where the Evidence Comes From
The evidence runs along two lines, and which line was available depended on the site. The 93 to 96 percent the abstract leads with comes from three of the four sites, not all of them.
2.1At three sites, the symptom records give the answer directly
The raw files from Budapest, Switzerland and Long Beach carry more than the chest pain type code. They hold separate fields for the detail of the pain: whether it sits behind the breastbone, whether exertion makes it worse, whether rest eases it. Under the documented reading, code 4 marks a patient with no pain, so all three fields should be empty. They were the opposite.
| Site | 'Asymptomatic (4)' patients | Patients with all three marks | Share |
|---|---|---|---|
| Budapest | 123 | 118 | 96% |
| Switzerland | 98 | 91 | 93% |
| Long Beach | 131 | 126 | 96% |
| Cleveland | No chest pain detail in the raw file, so this method cannot be applied | ||
▲ The three marks are pain behind the breastbone, pain that worsens with exertion, and pain that eases with rest. Source: calculated from Table 2 of arXiv 2611.33248
2.2Cleveland was matched against the original 1986 study
The Cleveland file, the most used of the four, holds no symptom detail. So the analysis took hold of something else, the original clinical study that Detrano and colleagues published in Circulation in 1986 on the same patient group. Matching the numbers in that paper against the data file settles which reading is right.
- • The patient counts by number of blocked vessels (55, 36, 35 and 13) match exactly between the file and the paper. That confirms it is the same patient group
- • Of the sixteen cells in the chest pain distribution table split by sex and by disease status, fifteen match the paper under the corrected reading. Read as the documentation says, not one cell matches
- • The regression coefficient of −1.10 for chest pain and the intercept of −2.29 that the paper reports reproduce only when 5−cp is substituted. Feed in the stored value as it is and the coefficient comes out at +1.10 and the intercept at −7.77
This article did not open the 1986 Circulation paper itself. The numbers above are carried over from what the arXiv analysis cites.
There is also a clue to when the reading hardened. In 1990 someone rewrote the Cleveland file's codes as words in a file called cleve.mod, and the documentation's labels are already baked into it. From the moment the value read 'typical angina' in letters rather than as a number, the reversed interpretation had moved inside the data and set.
The Scores Hold, the Interpretation Flips
It may sound strange that an error like this survived in data used for nearly forty years. The reason is simple. The error barely touches how well a model predicts.
3.1Conventional models never read the names
Logistic regression gave identical predictions whether chest pain went in as an ordinal variable or as one column per category. The AUC that keeps appearing in this article is the share of the time that, picking two patients at random, the model gives the higher score to the one who has the disease. A 1 means always right and a 0.5 is a coin flip. Cross-validated AUC came out at 0.903 and 0.911. Random forest and gradient boosting differed by no more than 0.002 in AUC. Individual predicted probabilities did move by as much as 0.07 or 0.15, but that came from the order of the category columns changing the random numbers used in the splits, not from the signal changing.
To a model, 1, 2, 3 and 4 are just four different slots. Only people read the names on those slots. That is why thousands of benchmark runs over this data never raised a flag in the numbers. What changed is the name tag attached to the coefficient. In the logistic regression with one column per category, the largest positive coefficient of +0.48 sits in the slot marked 'asymptomatic' and the negative coefficient of −0.25 sits in the slot marked 'typical angina'. That is where the conclusion comes from that patients with no pain are at higher risk.
3.2Models that read text are taken in
Things differ once the names reach the model as words rather than as numbers. The analysis turned the records of 303 Cleveland patients into sentences, fed them to three small language models quantized to four bits, and asked in one shot whether the patient has heart disease. One arm got the documented labels, the other the corrected ones. There were two prompts, one giving all thirteen variables and one giving age, sex and chest pain only.
Scores came from weighing the probability of 'yes' against 'no' at the model's first output token. No fine-tuning was involved, only the question, and the whole thing runs on the single graphics card Kaggle hands out for free. The chart below shows the second of the two prompts, the one giving age, sex and chest pain only. All three models have a longer bar with the corrected labels than with the documented ones, and the shortest bar sits to the left of the coin-flip line.
The gap opened up on the documented-label side. Qwen2.5-7B came in at an AUC of 0.458, worse than a coin flip, and rose to 0.789 once the labels were corrected. The three models gained between 0.122 and 0.331. In places the documented labels scored below what the models managed with chest pain dropped from the prompt altogether, which was 0.626 to 0.638. Giving the wrong name was worse than saying nothing.
Carrying these numbers anywhere means carrying the condition with them. The gain of 0.12 to 0.33 holds under the prompt giving age, sex and chest pain only. With all thirteen variables supplied, the difference shrinks to 0.016 for Qwen, 0.077 for Llama and 0.002 for Phi. Once enough other variables arrive, the model leans less on the chest pain name.
Of the Papers That Named a Risk Direction, Eight in Ten Got It Wrong
Predictive performance holding steady is not the same as nothing having happened. Papers have used this data to explain what a model based its judgment on, and those explanations are flipped end to end. Such papers mostly use SHAP, a tool that returns a score per variable for how much the model looked at it, and the name printed beside that score comes straight from the data documentation. The analysis counted how far this reaches.
A Google Scholar search over literature from 2010 onward, combining chest pain, asymptomatic, Cleveland, heart disease and SHAP, returned 269 items, and removing off-topic work and duplicates left 230. Of those, 150 were drawn in random order for full-text review, and 124 turned out to be readable. The random seed used for the shuffle is printed in the paper, so the same list can be drawn again in the same order. Among those 124, the papers that clearly stated a risk direction for a particular chest pain category numbered 32. Twenty-five of them, 78 percent, conflict with the corrected reading. The 95 percent confidence interval runs from 61 to 89 percent. On a second pass over the wording, 22 of them (69 percent) were classified as stemming from this documentation error.
Not one of the 124 readable papers caught the reversal. Nine of them went further and attached a clinical explanation to the flipped direction. What explainable AI produced as grounds was explaining an error in the data documentation rather than the model's judgment.
The analysis names three cases. A 2023 paper by Baghdadi and colleagues in Journal of Big Data wrote that asymptomatic patients carry roughly six times the heart disease risk of patients with atypical angina. A 2020 arXiv paper by Dave and colleagues called asymptomatic the most severe of the four types, counterintuitive but true. A 2025 paper by Harrou and colleagues in Computational Intelligence read it as matching the clinical finding that severe cardiovascular disease often presents without symptoms. All three attached a plausible medical reason to a reversed label.
Several caveats hang off that 78 percent. The search required 'asymptomatic' and 'SHAP' together, so the sample may tilt toward work where this error surfaces, and the author writes that the real rate is probably lower. One person did the classification and no second reviewer has gone over it. Seventeen percent of the sample could not be read in full, and only body text was extracted, so claims living inside figures went uncounted. The count of conflicting papers reads better as a lower bound.
Which Copies Are Affected
For anyone who has used this data even once, the first thing to check is which lineage their copy belongs to. Copies keeping the original 1 to 4, copies renumbered 0 to 3, and copies with words baked in place of numbers all circulate together. A copy that keeps the numbers only causes trouble when a person attaches names to them. A copy with words baked in has the wrong names sitting inside the data.
| Distributor | How it is stored | Downloads |
|---|---|---|
| UCI repository original | Codes 1 to 4. The documentation calls 1 typical angina | 1.26M views |
| Statlog (Heart) | 270 Cleveland patients, carrying the same codes over | — |
| Kaggle · fedesoriano | 918 rows. Words are baked in, and 'TA' is the original code 1 | 290,000 |
| Kaggle · redwankarimsony | 920 rows. Words are baked in, and 'typical angina' is the original code 1 | 112,000 |
| Kaggle · David Lapp | 1,025 rows. Only the end codes are swapped, no names are written, and the outcome variable is flipped too | 386,000 |
| OpenML heart-c · heart-h | Words are baked in, and typ_angina is the original code 1 | — |
| PMLB heart_disease_* | The original minus one. It calls 0 typical angina | — |
▲ The roughly 400,000 the abstract cites is the sum of the two Kaggle copies that spell the category names out as words. The author states the Kaggle copies were picked by vote count, so other popular copies may sit outside this list. The OpenML dataset IDs grouped in the same lineage are 49, 51, 53, 194, 786 and 1574. Source: arXiv 2611.33248
What stands out in the list is David Lapp's copy, the most downloaded of them all. It has 1,025 rows, but what is actually in there is 302 Cleveland patients carrying duplicates, with the end codes swapped and no names written. The outcome variable is flipped as well, so among the code 0 patients that correspond to the original code 4 (typical angina once corrected), only 25 percent are marked as having the disease. The group in the clearest pain looks like the healthiest group.
The author puts forward three recommendations. Repository maintainers should correct the labels or annotate the existing releases. Users on the 1 to 4 codes can read a stored k as the documentation's 5−k, while copies on 0 to 3 need the applied transformation identified first. And existing research that interpreted chest pain effects with this data needs another look. Results on the prediction performance side mostly stand.
5.1What was confirmed, what the author claims, and this article's reading
The three strands do not carry the same weight of evidence. The first two can be pointed at a paper or a repository page. The last one has nowhere to point but this article.
| Strand | Content |
|---|---|
| Confirmed against primary sources | That the UCI repository page still writes 1 as typical angina and 4 as asymptomatic. The 5−k rule the paper sets out and the mapping table for the four categories. The code 4 patient counts at three sites and the counts carrying all three marks (118/123, 91/98, 126/131). In the Cleveland comparison, the match on all four vessel counts, on 15 of 16 distribution cells, and on the regression coefficient of −1.10 with the intercept of −2.29. Conventional model AUCs of 0.903 and 0.911 with differences at or below 0.002. The AUC values across the six language model conditions. The step-by-step figures of the literature audit, 269 to 230 to 150 to 124 to 32 to 25, and the confidence interval. How each distributor stores the data, and the download counts |
| The author's claims | The conclusion that the codes are reversed, the classification attributing 25 conflicting papers to this error, and the three recommendations to maintainers and users. The paper states that one author carried out the work and that no second reviewer joined it. The Cleveland evidence rests on a single 1986 paper |
| This article's reading | The frame that treats a data dictionary as a quality control object of the same rank as the values, and the questions section 6 moves into practice, are not sentences from the paper but a construction made at the point where these results get used. The paper is written for researchers using this data, and section 6 faces the people who maintain the documentation of in-house data |
Why Pebblous Is Watching This Dataset
What a data quality check looks at is usually the values. It counts whether there are blanks, whether anything falls out of range, whether the same patient went in twice. Every one of those checks passes here. There are no missing values, no outliers, no duplicates. The numbers 1, 2, 3 and 4 sit exactly where they belong. What is wrong is the document that says what those numbers mean.
Define AI-Ready Data by the consistency of values alone and this error never gets caught. Saying that data is ready for AI has to carry both the condition that the values are right and the condition that the meaning of those values is written down correctly. The second half goes by several names, codebook, data dictionary, column documentation, and what they share is that nobody verifies them again after the first writing. The documentation for the UCI Heart Disease data held that state for close to forty years.
The more uncomfortable side is explainable AI. As with SHAP above, the variable names an explanation tool prints are set by the documentation. When the documentation is wrong, the explanation goes wrong in the same direction, and the more a result runs against intuition, the harder people look for a plausible reason to attach to it. Nine papers in this audit attaching clinical grounds to a reversed direction is the evidence. That an interpretation sounded plausible is no evidence that it was right.
Three things are worth checking on the datasets in use. None of the three is a matter of recomputing values. Each is a matter of opening a document and comparing by hand, which is why automated quality checks never catch them.
- • Who last verified the codebook. Checks on values run automatically, but checks on meaning mostly run for nobody. The documentation for this data has stood unchanged since 1988
- • Whether the category names have ever been compared against the source records. This reversal surfaced from matching one column against another inside the same file, the symptom detail fields. The answer was already in the data
- • What gets suspected first when an explanation runs against intuition. Had the order been to check the labels before concluding that the model had found a hidden pattern, this error would have been caught in the 2010s
Editor's Note
The part of this analysis that caught most is the cleve.mod file from 1990. Rewriting codes as words would have been a kindness, a step taken to make the data easier to work with. And it was exactly that step that transplanted the documentation's error into the body of the data. The structure in which a transformation meant to help people read ends up fixing an error in place is still with today's data pipelines. The analysis itself, meanwhile, is a preprint that has not been through peer review, carried out by a single author. The verification code and the coding data are public, so the next turn belongs to whoever runs them.
References
Primary sources
- 1.Tovinkere Pattabhi, T. (2026). "Typical Angina, Reversed: A Long-Standing Documentation Error in the UCI Heart Disease Data." arXiv:2611.33248.
- 2.Tovinkere Pattabhi, T. (2026). "anginaflip: reproduction code and coding data." GitHub.
Academic
- 3.Detrano, R., Leatherman, J., Salcedo, E. E. et al. (1986). "Bayesian Analysis versus Discriminant Function Analysis: Their Relative Utility in the Diagnosis of Coronary Disease." Circulation, 73(5), 970–977. The original clinical study behind the Cleveland comparison; this article cites only what the arXiv analysis quotes from it.
- 4.Detrano, R., Jánosi, A., Steinbrunn, W. et al. (1989). "International Application of a New Probability Algorithm for the Diagnosis of Coronary Artery Disease." The American Journal of Cardiology, 64(5), 304–310. The paper the UCI repository names as the introductory reference for this dataset.
- 5.Baghdadi, N. A., Farghaly Abdelaliem, S. M., Malki, A. et al. (2023). "Advanced Machine Learning Techniques for Cardiovascular Disease Early Detection and Diagnosis." Journal of Big Data, 10, 144.
- 6.Dave, D., Naik, H., Singhal, S., Patel, P. (2020). "Explainable AI Meets Healthcare: A Study on Heart Disease Dataset." arXiv:2011.03195.
Data sources
- 7.Janosi, A., Steinbrunn, W., Pfisterer, M., Detrano, R. (1989). "Heart Disease." UCI Machine Learning Repository. DOI 10.24432/C52P4X.
- 8."Statlog (Heart)." UCI Machine Learning Repository. DOI 10.24432/C57303.