Can machine-learning improve cardiovascular risk prediction using routine clinical data?
Cardiovascular disease is still the world's biggest killer, and here's the frustrating part: a lot of heart attacks and strokes happen to people who don't look high risk on our standard calculators. You can have normal blood pressure, decent cholesterol, no diabetes, and still end up in the hospital. Meanwhile, plenty of people flagged as high risk will never have an event and will carry the anxiety and side effects of treatment anyway.
Roughly half of heart attacks and strokes occur in individuals that the usual scores don’t label as high risk. This mismatch provides an opportunity for a better predictor.
Weng and colleagues leaned straight into this with a pragmatic question: if you input the messy, routine data from general practice into machine learning algorithms, can you get sharper 10-year cardiovascular risk predictions than the standard equations from the American College of Cardiology and the American Heart Association? And not just better curves on a paper—better decisions at the point where clinicians actually act, which, for statins, is a 10-year risk above seven and a half percent. The promise is simple: find more people who will truly benefit from preventive therapy and spare more people who won't.
The data backbone is the UK's Clinical Practice Research Datalink, a huge, anonymized slice of everyday primary care from nearly seven hundred family practices. Think demographics, problem lists, prescriptions, labs, and hospital links—the routine trail of modern medicine. The cohort here was extensive: 378,256 adults, ages 30 to 84, free of cardiovascular disease at baseline on January 1, 2005, then followed for a decade.
Over that span, 24,970 people had a first cardiovascular event, about six point six percent. That's exactly the kind of base rate that makes prediction tricky: events are uncommon, but not rare enough to ignore.
They started with the same eight variables that power the American College of Cardiology and American Heart Association calculator—age, sex, smoking status, systolic blood pressure, whether you're treated for blood pressure, total cholesterol, high-density lipoprotein cholesterol, and diabetes. Then they widened the lens. Twenty-two additional candidates came in from prior risk tools, the literature, and clinician input: things like atrial fibrillation, chronic kidney disease, chronic obstructive pulmonary disease, rheumatoid arthritis, use of oral corticosteroids, triglycerides, body mass index, and socioeconomic deprivation.
In all, thirty pre-baseline variables went into the machine learning models. And because real-world data are full of holes, missing continuous values were filled in with the median and flagged with a missing indicator. For ethnicity and deprivation, there was an unknown category. Missingness wasn't brushed under the rug—it was treated as a potential signal.
Four model families took the field: logistic regression, random forest, gradient boosting machines, and neural networks. These methods weren't picked for novelty points; the team chose methods they believed could be easily integrated into current UK primary care electronic health records. They split the cohort seventy-five to twenty-five into training and validation sets—about 295,000 to learn from, and 83,000 to test on—and tuned hyperparameters with a grid search and two-fold cross validation.
If you're keeping score on tooling, they used RStudio, with caret for the neural networks and H2O for the others. Evaluation happened at two layers. First, discrimination across the entire risk range was measured by Harrell's C-statistic—the area under the receiver operating characteristic curve.
Then the rubber-meets-the-road test at the seven point five percent decision threshold: how many true cases do you catch, known as sensitivity, how many non-cases do you correctly leave alone, known as specificity, and what are the positive and negative predictive values.
Start with the headline. The established American College of Cardiology and American Heart Association model reached an area under the curve of 0.728 on the validation set. All four machine learning models beat it.
Random forest nudged the area under the curve to 0.745, a one point seven point bump. Logistic regression and gradient boosting were neck-and-neck at 0.760 and 0.761, gains of about three points. The top performer, neural networks, achieved 0.764—up three point six points from baseline.
To put that into plain terms: the models got better at ranking who is more likely versus less likely to have a cardiovascular event over the next decade. It's not a revolution, but in risk prediction, a few points of area under the curve often translate into many people correctly classified at scale.
Okay, but what happens when you lower the threshold to seven point five percent and ask, "Who should get a statin?" On the validation cohort, using the standard calculator, clinicians would have caught four thousand six hundred forty-three of the seven thousand four hundred four people who would go on to have an event—that's sixty-two point seven percent sensitivity—with a positive predictive value of seventeen point one percent. In other words, most flagged patients wouldn't actually have an event, but because events are relatively rare, that's expected. Now watch what the machine learning models do at the same threshold.
Random forest picked up one hundred ninety-one additional true cases. Logistic regression added three hundred twenty-four. Gradient boosting added three hundred fifty-four.
And the neural network added three hundred fifty-five, identifying four thousand nine hundred ninety-eight of the seven thousand four hundred four cases—sixty-seven point five percent sensitivity—with a positive predictive value of eighteen point four percent. That's a seven point six percent increase in correctly predicted cases over the established approach.
The gains weren't just on the case side. For people who would not have a cardiovascular event over the decade—the large majority—the standard tool correctly alerted fifty-three thousand one hundred six of seventy-five thousand five hundred eighty-five that they were below the threshold, a specificity of seventy point three percent and a negative predictive value of ninety-five point one percent. The machine learning models improved that too, correctly classifying an extra one hundred ninety-one to three hundred fifty-five non-cases depending on the algorithm.
The neural network version correctly reassured fifty-three thousand four hundred fifty-eight non-cases, nudging specificity to about seventy point seven percent and the negative predictive value to ninety-five point seven percent. So you get more true positives and more true negatives at the same clinical bar. That's the kind of shift that matters in clinics where decisions are binary: start a drug, or don't.
Take a breath on what these numbers mean. Positive predictive values in the high teens can feel underwhelming at first glance. But with events at about six point six percent over a decade, and treatments like statins that are low cost and relatively safe, small absolute lifts in discrimination and sensitivity at the threshold can redirect tens of thousands of decisions.
More people at real risk get therapy earlier. More people unlikely to benefit avoid unnecessary medication.
Now, what did the models learn about risk itself? The usual suspects still loomed large: age, total cholesterol, high-density lipoprotein, and smoking floated to the top across models. But there were interesting twists.
Diabetes, a key risk factor in classic scores, did not dominate the machine learning rankings; in some models, a diabetes proxy like hemoglobin A1c carried more signal. Several comorbidities and treatments—chronic obstructive pulmonary disease, severe mental illness, oral corticosteroid use, atrial fibrillation, chronic kidney disease, and rheumatoid arthritis—showed up as meaningful contributors. Triglycerides mattered in some models.
And in one moment of real-world data insight, the neural network treated "body mass index missing" as a protective flag. That's not magic; it's a clue about patterns in care. People whose body mass index is never recorded may be systematically different—perhaps younger, healthier, or seen less often—than those with repeated measurements.
Treating missingness as a variable can reveal those latent patterns, even if the signal is messy.
This is also where interpretability gets challenging. Logistic regression is familiar and relatively transparent; you can point to coefficients and say, "This factor pushes risk up, that one down." Random forests and gradient boosting let you rank variables and peek at marginal effects, but interactions and non-linearities multiply quickly. Neural networks, which performed the best here, are notoriously opaque.
Weng and colleagues acknowledged that. They relied on visualization and variable importance summaries to shed some light on the black box, but they didn't pretend to have a simple story for every interaction inside the network. The trade-off is the trade-off: slightly better performance at the cost of clarity.
A few practical choices made these models feel grounded in clinical reality. The algorithms were selected with "can we actually plug this into a primary care system?" in mind. Handling missing data was part of the design, not an afterthought.
The evaluation was anchored to a decision that clinicians already use, not a theoretical optimum. That's good science hygiene when the target is practice, not just publication.
There are, of course, caveats. These are internal validation results from one large, representative UK database. Generalizing to other health systems—different coding habits, different patient mix, different lab practices—requires external validation.
The team used median imputation for continuous variables and "unknown" for some categories; that's pragmatic, but it can embed local data quirks into the model. More predictors raise the specter of overfitting; grid search, cross validation, and regularization help mitigate that risk, but they don't eliminate it. Even details like jackknife standard errors, which are acceptable here, might behave differently in other contexts.
And regardless of method, any risk tool deployed in the real world needs recalibration checks and ongoing surveillance because populations, treatments, and data pipelines can drift.
What about the clinic? You could imagine these models running as a service—an application programming interface fed by the electronic record, returning a risk score and, crucially, a call at seven point five percent with some context on why. That last part—why—really matters.
If the best performing option is a neural network, clinicians will still want a sense of which features tipped the scale and how stable the estimate is. Variable importance plots, partial dependence narratives, and case-based explanations can help, though none fully solves the transparency gap. Still, the team's emphasis on methods that are already compatible with UK systems reduces the friction. It's not the moonshot; it's a short hop to something usable.
Step back and look at the arc. We began with a stubborn fact: too many cardiovascular events evade our standard risk nets, and too many people are swept into treatment with little to gain. Weng and colleagues show that with routine primary care data and off-the-shelf machine learning, you can tighten the net.
The jump from an area under the curve of 0.728 to 0.764 may sound modest, but at the seven point five percent threshold that clinicians actually use, it means three hundred fifty-five more true cases caught and roughly the same number of unnecessary treatments avoided in a validation set of eighty-three thousand people. Scale that to a nation, and you're talking about thousands of events prevented and thousands of patients spared pills they don't need.
Where does this go next? Two short moves would make the picture sharper. First, external validations across different countries and data systems, with a focus on calibration—does a predicted 10-year risk of eight percent actually mean about eight percent everywhere you try it?
Second, deployment with transparency: explainability artifacts alongside the score and monitoring dashboards that flag when performance drifts. After that, the bolder step is dynamic updating—models that learn as new data arrive—paired with governance to ensure that "learning" doesn't quietly encode new biases.
For now, the take-home is clear. With thoughtful modeling of the data we already have, cardiovascular risk prediction can be nudged meaningfully in the right direction. It's not about replacing clinical judgment or abandoning simple rules.
It's about better triage at the margin, where a few percentage points decide whether a person spends the next decade on a daily pill or whether a silent plaque keeps growing in an artery they've never thought about.
Related lectures
- Stress, burnout and doctors' attitudes to work are determined by personality and learning style: A twelve year longitudinal study of UK medical graduates
- Work stress in the etiology of coronary heart disease—a meta-analysis
- The influence of education on health: an empirical assessment of OECD countries for the period 1995–2015
- Real-time ultrasound-guided catheterisation of the internal jugular vein: a prospective comparison with the landmark technique in critical care patients
- Is job strain a major source of cardiovascular disease risk?
- Rethinking the patient: using Burden of Treatment Theory to understand the changing dynamics of illness