Undiagnosed hepatitis C: an explainable model trained on health records from all of Andalusia finds 63% of cases, but only one flag in fourteen is a true case
An Andalusian team trained an interpretable machine learning model on the region's health records, including 25,028 hepatitis C diagnoses made between 2017 and 2024, to find people who are infected but do not yet know it. Tested unchanged on a random 2024 sample, it picks up 63.5% of future diagnoses, but only 7% of the patients it flags actually have the disease. The work is methodologically careful on several points and remains a proof of concept: one region, no head-to-head numbers against existing screening strategies, and a "bias audit" whose results do not appear in the text.
The context
Hepatitis C is a viral liver infection that often progresses silently for years, up to cirrhosis or liver cancer. Since direct-acting antivirals arrived, a few weeks of pills cure the vast majority of patients. The bottleneck is no longer treatment but diagnosis: according to the authors, 25 to 30% of active infections in Spain are still undiagnosed.
Two classic strategies coexist: test everyone in certain age bands, or target people with known risk factors (injection drug use, HIV, past transfusion). The second misses many cases; the first is expensive. Hence the idea, already explored in the United States, Israel and Korea, of using data already in the medical record (lab tests, coded diagnoses) to automatically flag patients for testing. Published models report AUCs from about 0.77 to 0.95. So the question is not "is it feasible?" but "is it usable, and at what cost in false positives?".
The method
The data come from the Base Poblacional de Salud (BPS), which covers more than 16 million users of the Andalusian public health system, analysed inside a secure research environment. Cases are everyone diagnosed with hepatitis C between 2017 and 2024 (n = 25,028); the text does not give the exact definition (diagnostic codes, serology or viral RNA). For training, each case is matched to controls of the same sex, age and health district, at a realised ratio of about 9.2 controls per case (213,404 controls).
Inputs are coded chronic conditions (HIV, substance dependence, obesity, diabetes, COPD, etc.) and summary statistics (mean, standard deviation, minimum, maximum) of lab results: ALT and AST liver enzymes, platelets, GGT, haemoglobin and others. Only data recorded at least 30 days before the diagnosis date are used, to limit data leakage: without that gap, the model would see tests ordered precisely because hepatitis was already suspected.
The model is an Explainable Boosting Machine (EBM), developed by Microsoft Research in the InterpretML library. It is an additive model: the prediction is a sum of per-variable contributions, each learned by boosting (a sequence of small decision trees, each correcting the errors of the previous ones). One can therefore plot, for every variable, the exact curve of its effect on risk. It is compared with regularised logistic regression.
Validation is temporal: training on 2017-2022 diagnoses, tuning the decision threshold on 2023 to guarantee at least 60% sensitivity (sensitivity is the share of sick people the model flags), then a "blind" test on 2024. Crucially, the test set is not matched: it contains 1,881 cases and 193,054 controls drawn at random from the population, a prevalence of about 1%. That is closer to reality than the balanced test sets often seen. After an explainability review, the authors removed two variables judged to mainly reflect social disadvantage (the income-based pharmaceutical co-payment bracket and an area deprivation index), as well as dyslipidaemia, with no written rationale for the latter.
The results
ML metrics on the 2024 test set: AUC 0.837 (0.826 in validation, 0.841 in training). The AUC, or area under the ROC curve, measures the ability to rank a sick person above a healthy one: here, in about 84% of random pairs. At the chosen threshold, sensitivity is 63.5% (1,195 of 1,881 cases), specificity 91.8%, positive predictive value (PPV, the probability that a flagged patient is truly infected) 7.0%, and negative predictive value 99.6%. The area under the precision-recall curve, a tougher measure when positives are rare, drops to 0.240 in testing versus 0.542 in validation, a fall largely explained by moving from a matched set to 1% prevalence.
The most influential variables are minimum ALT (a persistently raised liver enzyme signals liver damage), HIV infection, non-tobacco substance dependence and platelet statistics. Performance declines when a longer gap between data and diagnosis is imposed (from 30 to 720 days). Calibration, the agreement between predicted probability and actual risk, is imperfect: the model underestimates risk at high probabilities, and the recalibrations tested were not adopted.
Clinical translation, from the published counts and scaled to 1,000 people in the test population (about 10 of whom will be diagnosed in 2024): the model flags about 88. Of those, 6 are true cases and 81 are false positives; 3 to 4 cases slip through. So about 14 flagged people must be tested to find one infection. In a population with lower prevalence than this test set, say 0.3%, the same sensitivity and specificity would give a PPV of about 2%, one case for roughly fifty tests.
What is good
First, a realistic test set. Many screening models are evaluated on matched or balanced sets that inflate PPV. Here the threshold is frozen on 2023 and then applied to a random 2024 sample at about 1% prevalence, and the authors publish the 7% PPV and the 93% false discovery rate instead of hiding them behind the AUC.
Second, a genuinely readable model. The EBM shows the effect of each variable, and this was put to concrete use: the explainability review led to the removal of two socioeconomic variables the model was using as a shortcut. The 30-day gap before diagnosis and the sensitivity analysis out to 720 days show real attention to leakage.
Third, scale and frugality. A population database of more than 16 million users, 25,028 cases, and only routinely collected data: no extra test, no imaging. If the approach holds up, it can be deployed at low cost in any health system with a comparable data warehouse.
What is less good
First, a risk of shortcut learning built into the label itself. The model learns to predict who will receive a diagnosis, not who is infected. People living with HIV or treated for addiction are exactly those who are already tested most; that these variables top the list is unsurprising and says little about the ability to find truly hidden infections in patients with no known risk factor. On top of that, the test set has a profile gap: cases average 59.5 years and are 67.9% male, versus 49.9 years and 48.6% male for random controls. Age and sex are not model inputs, but chronic conditions and lab values that depend on them are; part of the test discrimination may therefore reflect age rather than hepatitis.
Second, a "bias audit" announced but not shown, and a missing comparator. The title promises a "bias-audited" model and the discussion mentions consistent performance across health districts, yet the version we read presents no numbers by sex, age, district or socioeconomic level. Nor is there a numerical comparison with the strategy that must be beaten, risk-factor-based or age-based screening; other models are compared only through the literature. There are also inconsistencies to fix: two different thresholds (0.1793 and 0.1437) for the main model, and matching described sometimes by age, sometimes by birth year.
Third, population bias and independence questions. Validation is temporal within a single region, with no external validation; the authors acknowledge this, along with differences in coding and epidemiology (HIV co-infection, injection drug use) between systems. Data are under controlled access and code availability is not confirmed in the text. Finally, the study is partly funded by Gilead Sciences, a maker of hepatitis C antivirals, with no competing-interests statement or description of the funder's role in the version we consulted. That is not evidence of bias, but readers should know it.
What it changes
For the research community: this work models good practice, evaluating at realistic prevalence and publishing PPV, and offers an interpretable baseline to build on. The missing steps are clear: publish subgroup results, compare with numbers against risk-factor screening, validate in other regions, then measure prospectively how many additional diagnoses and treatments an alert actually produces.
For clinicians: nothing deployable today. But the logic deserves attention: a hepatitis C antibody test is simple, and flagging fourteen patients to find one curable infection may be acceptable, provided one checks that the cases found are not those targeted screening would have found anyway, and that alerts do not overload primary care teams.
For patients and the public: the idea is that the medical record itself suggests a blood test to someone who does not know they are at risk. That raises legitimate questions about the use of health data and about stigma, since some variables (HIV, addictions) are sensitive. The underlying stake remains positive: every infection found is, today, almost always curable.
Further reading
The preprint: An explainable, bias-audited machine learning model to detect hidden hepatitis C from region-wide real-world health records, medRxiv, posted 6 November 2026, DOI 10.64898/2026.11.05.26367298, not peer reviewed. Authors: Alberto Esteban-Medina, Carlos Loucera, Joaquín Dopazo (Barcelonaβeta Brain Research Center, Hospital del Mar Research Institute, Andalusian Platform for Computational Medicine) and Manuel Romero Gómez (Institute of Biomedicine of Seville, Virgen del Rocío University Hospital). Funding: Gilead Sciences Spain, Spanish Ministry of Science, Instituto de Salud Carlos III, Junta de Andalucía, Horizon Europe (MLCARE). Tool: the open-source InterpretML library, which implements the EBM.
Editorial transparency note: this article was produced by Tatakoto's automated editorial pipeline from version 1 of the preprint; the supplementary tables and figures could not be consulted. The "per 1,000 people" figures and the 0.3% prevalence simulation are our own calculations from the published counts. The English, Spanish and Chinese versions are AI-generated. Spotted an error? Contact us.