Privacy and preparation
Rare case privacy utility tradeoff: 1.30% of rows, 46.79% of codes
By SourceX Editorial · Reviewed by Noah Loul ·
10 sections
Short answer
Settle a rare case privacy utility tradeoff by measuring it, not by deleting on reflex. In 101,745 de-identified US hospital encounters, dropping diagnosis codes seen fewer than 11 times removed 1.30 percent of records but 46.79 percent of the code list, and those patients were readmitted less often. Swapping codes for their chapter cut small-group exposure from 100 to 10.09 percent, yet scored rare cases worse than dropping the diagnosis entirely.
Redaction
Rare case privacy utility
Key takeaways
- A minimum-count rule is cheap in rows and expensive in coverage: below 11 encounters, 335 of 716 primary diagnosis codes accounted for only 1,318 of 101,745 encounters.
- Rare cases are not a random slice of the file: their 30-day readmission rate was 8.88 percent against 11.19 percent for the rest, so deleting them shifts what both a model and its test see.
- On age band, gender, race and code alone, 71.47 percent of rare-code encounters belonged to a patient with no one else in the same group, against 4.05 percent of other encounters.
- A safer representation has to pass its own test: chapter codes cut the small-group share to 10.09 percent but lowered rare-slice AUC by 0.026, more than removing the diagnosis field did.
- Keeping rare cases out of training but in a restricted evaluation set cost 0.007 of rare-slice AUC and kept the test able to see them.
What does the rare case privacy utility tradeoff decide?
It decides what happens to records whose value comes from the same distinctive detail that makes them identifiable: deliver them as they are, represent them more coarsely, keep them only for testing, or leave them out. Three measurements settle it: how distinctive each rare record is in the delivery, how much the buyer's task depends on that detail, and whether a safer representation still passes the task's test.
The tempting shortcut is a blanket rule that drops anything seen fewer than N times. This article measures what such a rule costs on a real, public and already de-identified file of US hospital encounters, and compares it with three alternatives on the same records. The finding is not that rare cases must always stay, or always go. Each option has a price, and the price can be counted before anyone signs off.
The existing guide to rare event identification risk covers how to assess each rare class and which treatments to consider. This page puts measured numbers on one choice within that process, exclusion against a safer representation, and shows that the intuitive answer can be wrong.
What does a minimum-count rule remove from a hospital file?
Far more of the meaning than of the rows. The Diabetes 130-US hospitals file is described by UCI as ten years of care, 1999 to 2008, at 130 US hospitals and integrated delivery networks; 101,745 of its inpatient encounters carry a primary diagnosis code, drawn from 716 distinct codes. A rule that removes codes seen fewer than 11 times takes out 335 codes, 46.79 percent of the list, but only 1,318 encounters, 1.30 percent of the records.
The threshold of 11 is borrowed, not invented. CMS, part of HHS, applies a cell size suppression policy to statistics produced from its data under data use agreements: no cell such as admittances, discharges or patients below 11 may be published or displayed. That policy governs published counts, not record-level deliveries, and it is not a general legal standard for private business records; it serves here only as a recognizable review threshold. At thresholds of 5 and 25 the pattern holds: 29.05 percent of codes against 0.42 percent of encounters, and 60.20 percent against 2.86 percent.
Injury and poisoning codes make up the largest group of rare codes, 88 of the 335, ahead of nervous system and sense organ codes at 39 and neoplasms at 38. These are the unusual admissions a model meets least often in training and most needs to be tested on.
Are rare cases different from the rest, or only rarer?
In this file they are different. Encounters with a rare code were followed by a 30-day readmission 8.88 percent of the time, with a 95 percent interval of 7.46 to 10.53, against 11.19 percent (10.99 to 11.38) for all other encounters. At a threshold of 5 the rates were 8.90 and 11.17 percent; at 25, 10.06 and 11.19 percent.
A deletion rule therefore changes the population, not just its size. NIST's guidance on de-identifying government datasets, SP 800-188 (2023), warns: "Redaction may also reduce the accuracy of the dataset since the use of selective redaction may result in the introduction of non-ignorable bias." Here the bias has a direction: removing rare-code encounters takes out a group with fewer early readmissions, so both the model and its evaluation see a slightly riskier population than the hospitals actually treated.
The gap is modest and the intervals widen as groups shrink. What matters for the review is that the difference exists, has a sign and can be measured before a rule is chosen, rather than discovered after a buyer's model misbehaves on the cases it never saw.
How identifiable is a rare diagnosis in a de-identified file?
Very. Using only age band, gender, race and the primary code, 942 of the 1,318 rare-code encounters, 71.47 percent, belong to a patient who is the only one with that combination. All 1,318 sit in groups of fewer than 11 patients, which follows from the rule itself, since each rare code appears fewer than 11 times. For all other encounters the shares are 21.44 percent in small groups and 4.05 percent alone.
Those four fields are already in the public file, which holds no names, service dates or facility identifiers. No linkage to any outside data was attempted for this article; only group sizes were counted. But the ICO's motivated intruder test asks what someone could do with means reasonably likely to be used, and for a rare admission the people with prior knowledge sit close by: the treating team, the billing office, a relative.
Rule-makers that publish fixed methods tend to coarsen rare values rather than delete whole records. The HHS Safe Harbor method for US health data recodes ages over 89 into one category of 90 or older, and changes the first three digits of a ZIP code to 000 where the area they cover holds 20,000 people or fewer. The record survives; the distinctive detail does not.
Exclude, test-only or coarsen: the measured comparison
On this file no option wins every column, which is why the choice needs numbers. Each option is scored on two things: how many rare-code encounters remain in groups of fewer than 11 patients, and how well a 30-day readmission model ranks the rare-code encounters, measured as out-of-fold AUC on the 1,318 rare cases, 117 of them readmitted.
The model is a plain logistic regression on age band, gender and race, admission details, utilization counts, laboratory and medication flags, and the diagnosis in whatever form an option allows, trained and scored across five folds split by patient. Across all encounters the options barely differ, with AUC between 0.665 and 0.671. On the rare slice they separate.
Each option, what the recipient receives and what it costs on this file:
| Option | What the recipient receives | Rare cases in groups under 11 patients | Rare-slice AUC, change vs exact (95% interval) | Reading |
|---|---|---|---|---|
| A. Keep the exact code | All 1,318 rare-code encounters with their codes | 1,318 of 1,318 (100.00%) | 0.735, the baseline | Most useful and most exposed; needs a written reason and tight access |
| B. Replace the code with its chapter | All encounters, codes coarsened to 18 chapter groups | 133 (10.09%) | 0.709 (-0.026; -0.042 to -0.011) | Safer, but rare cases rank worse than with no diagnosis at all |
| C. Exclude from training, keep for evaluation | Training copy without the 1,318; a separate evaluation copy keeps them exact | 1,318 (100.00%), in the evaluation copy only | 0.727 (-0.007; -0.013 to -0.002) | Small training cost; the test can still see rare cases |
| D. Drop the diagnosis field | All encounters, no primary diagnosis | 5 (0.38%) | 0.727 (-0.007; -0.015 to about 0) | Cheap for this task, fatal for any task that needs the diagnosis |
| E. Exclude from the delivery | 98.70% of encounters and 381 of 716 codes | None delivered | Cannot be measured | Removes 117 readmissions and every way to test rare cases |
Why did the safer code score worse than no code?
Because a coarse category carries the common cases' risk into the rare ones. Replacing each code with its chapter puts a rare injury code in the same group as every common injury admission, so the model hands the rare case the chapter's average risk. Dropping the field instead lets the model fall back on utilization and admission details, which on this slice ranked rare cases better: 0.727 against 0.709.
The lesson is about procedure, not a verdict on chapters. A safer representation is a hypothesis that it keeps the signal the task needs, and it has to be tested on the rare slice, where averages hide the damage: the all-encounter AUC moved only from 0.671 to 0.667. A different task, such as coding review where the diagnosis is the label itself, would rank the same options differently, which is exactly why the test belongs to the use rather than to the file.
The strongest objection: if the model barely uses rare codes, why keep them?
Because training and testing need rare cases for different reasons. Removing the 1,318 rare-code encounters from training cost 0.007 of rare-slice AUC, interval -0.013 to -0.002, so for this model they add little training signal. But the model ranked the rare slice at 0.735 against 0.671 overall, and the slice has its own readmission rate. A test set without those cases can show neither fact.
That points to a middle option blanket rules miss: keep rare cases out of the training copy, or coarsened in it, and hold them exact in a separate evaluation set with tighter access and a named holder. The records stay identifiable to whoever holds that set, so the access record and the use statement matter as much as the counts.
Removing direct identifiers does not end the question in either direction. Even with every rare code set aside, 4.05 percent of the remaining encounters belonged to a patient alone on age band, gender, race and code. Excluding the tail is not a route to anonymity, and keeping it is not automatically a breach; both are choices with measurable consequences.
Rare-case decision rules for a delivery
Write the rules before counting, then apply them class by class. These rules turn the three measurements into a decision a second reviewer can audit:
At a glance
Rare-case decision rules for a delivery
- Count first: report the rare classes, their share of records and their share of the code or label list at the threshold you intend to use, before deleting anything.
- Compare outcomes: if rare cases differ from the rest on the task's outcome, deletion biases training and testing, and the difference goes on the record.
- Measure distinctiveness on the fields an outsider could know, in the population delivered, with the threshold written down first.
- If the task needs only the pattern, test a coarser representation on the rare slice and adopt it only if the slice result holds.
- If testing needs the exact detail but training does not, split the copies: coarse or absent in training, exact in a restricted evaluation set with a named holder.
- If neither training nor testing needs the detail, drop the field rather than the records.
- Exclude records only when no representation passes both the identifiability bar and the task test, and state what the exclusion removed.
- Recount after export, since a join can restore a rare detail that the review took out.
Rare cases in a SourceX licensing review
SourceX's trust page leaves scope with the supplier: the supplier decides which systems, records and date ranges are in scope, and everything else stays out. A supplier that has counted its rare classes in advance can make that call knowingly instead of discovering the tail later.
Per the same page, once SourceX gives the go-ahead, the data is "extracted, transferred and de-identified through approved processing routes", and the legal-framework page notes that the method used is recorded for each dataset. For health information covered by HIPAA, that page says the data is not licensed in identifiable form and needs Safe Harbor or an expert determination before it is used or shared. It also does not oversell the result: no method is perfect, and re-identification may still be possible.
The first conversation needs no records. The company assessment asks about systems and history without any upload, and it is not an offer.
Methods note: data, rules and limits
Data: diabetic_data.csv from UCI dataset 296, Diabetes 130-US hospitals for years 1999-2008, which UCI lists with 101,766 instances. archive.ics.uci.edu is not reachable from this environment, so the file was read from the third-party GitHub copy neelagirichandrika/diabetes at commit 84bef2a. A second copy, rischanlab/Cleaning_diabetes_130_US_hospital_dataset at commit 433661b, is byte-identical once Windows line endings are converted, and both hold 101,766 data rows, matching UCI's count. A rerun on UCI's own download is listed as a release check.
Rules as applied by bin/rare_case_diabetes.py: the 21 rows with a missing primary diagnosis are dropped; a code is diag_1 exactly as written (no two code strings in the file denote the same number); a rare code has fewer than K encounters among the 101,745 analysed rows, with K of 5, 11 and 25 and 11 as the headline. Readmission means the value <30, and rate intervals are Wilson 95 percent intervals. Chapters follow ICD-9-CM code ranges, for example 390-459 circulatory and 800-999 injury and poisoning, with V and E codes as their own groups. Group size is the number of distinct patients sharing age band, gender, race and the code in the form an option keeps.
The model is logistic regression fitted with 400 full-batch Adam steps (learning rate 0.05, a penalty of 0.0001 times the sum of squared weights with the intercept excluded, all weights starting at zero) on 11 categorical inputs (age, gender, race, admission_type_id, discharge_disposition_id, admission_source_id, max_glu_serum, A1Cresult, insulin, change and diabetesMed) plus the diagnosis in each option's form and 8 numeric inputs (time_in_hospital, num_lab_procedures, num_procedures, num_medications, number_outpatient, number_emergency, number_inpatient and number_diagnoses) standardized with the training folds' mean and standard deviation; a category value unseen in training gets weight zero. diag_2 and diag_3 are not used, and folds are patient number modulo 5. AUC uses average ranks for ties. Intervals for AUC differences come from 2,000 bootstrap resamples of the rare slice, drawn with numpy's default_rng seeded 20261028, one integers call per resample, all drawn before scoring and shared by every option; a resample with no readmission or only readmissions would be skipped, and none was. Option D's interval reaches -0.0001 at this seed, but its upper end is about zero across seeds: with seeds 1 to 10 it runs from -0.0005 to 0.0005. A fold-0 check of the exact and chapter options at 1,200 steps moved rare-slice AUC by at most 0.002. Percentages are rounded once, half up.
Not measured: any linkage or re-identification attempt (none was made), other tasks or model types, the secondary diagnoses and real deliveries. The file is de-identified research data, not a SourceX dataset. Rule-maker text comes from HHS and CMS, NIST, CDC and the ICO through searches limited to their own domains on 2026-10-28. General information, not legal advice.
Frequently asked questions
What counts as a rare case in business records?
Any record whose value comes from a detail few other records share: an unusual diagnosis, a one-off claim type, the only customer in a region. In this article a rare case is a primary diagnosis code that appears fewer than 11 times in the file; the threshold is a choice, so state it and show what changes at others.
Is a minimum cell size of 11 a legal requirement for business data?
No. CMS applies an 11-count suppression policy to statistics published from its own data under data use agreements in the US; it is not a general rule for private business records. A reviewer can borrow it as a threshold but should write down why it fits the recipient and the use.
Does generalizing a rare value always keep the data useful?
No. On this file, replacing diagnosis codes with their chapter cut the share of rare cases in small groups from 100 to 10.09 percent, but lowered rare-slice AUC by 0.026, more than dropping the diagnosis field. Test the coarser form on the rare slice before adopting it.
Can rare cases be kept only for evaluation?
Yes, as a deliberate option: leave them out of the training copy or coarsen them there, and hold them exact in a separate evaluation set with a named holder and tighter access. They stay identifiable to whoever holds that set, so the access record matters.
Does deleting rare cases make a dataset anonymous?
No. With the rare codes set aside, 4.05 percent of the remaining encounters still belonged to a patient alone on age band, gender, race and code. Anonymity depends on all the fields and on the recipient, not on removing the tail.
Sources
- Third-party GitHub copy of the Diabetes 130-US hospitals file read for every measured figure in this article. Source
- A second copy of the same file, byte-identical after line-ending conversion. Source
- UCI describes the dataset as 101,766 encounters from ten years of care at 130 US hospitals and networks. Source
- CMS bars publishing or displaying any cell below 11 from CMS data under its data use agreements. Source
- HHS Safe Harbor recodes ages over 89 and zeroes three-digit ZIP codes for areas of 20,000 or fewer people. Source
- NIST SP 800-188 warns that selective redaction may introduce non-ignorable bias. Source
- ICD-9-CM chapter code ranges used to coarsen diagnosis codes. Source
- The ICO's motivated intruder test considers means reasonably likely to be used to identify people. Source
- SourceX's trust page on supplier-set scope and preparation through approved processing routes. Source
- SourceX's legal-framework page on HIPAA data, recorded methods and residual risk. Source
See if your company qualifies
A short company assessment. No data uploads are needed.