Work

Machine learning risk prediction models for repeat STI diagnosis: External validation across diverse clinic populations

Year: 2026
Type: article
Study design: Observational Study
Abstract: Background: A risk prediction model is only as good as its performance in a population it has never seen. Machine learning algorithms trained to predict repeat sexually transmitted infection (STI) diagnosis have shown promising discrimination in development cohorts, but external validation testing the model on data from clinics with different demographics, STI prevalence and care pathways is sparse. Without such validation, deploying a model risks miscalibration, inequitable risk stratification and clinical decisions anchored in overconfident probability estimates. Portugal, with its network of Serviço Nacional de Saúde sexual health clinics serving geographically and sociodemographically diverse populations, offers an opportunity to test whether a model developed in one clinic transfers to others. Objective: To externally validate a machine learning risk prediction model for repeat STI diagnosis within 12 months across three Portuguese sexual health clinics with distinct population profiles. Methods: The research is reported in line with the TRIPOD statement for prediction model validation. A gradient-boosted decision tree model, originally developed on data from a Lisbon clinic (n = 1,204), was externally validated on retrospective electronic health record data from three clinics in Coimbra, Porto and Faro (combined validation n = 874; development period January 2019-December 2022; outcome ascertainment to December 2023). The primary outcome was any laboratory-confirmed STI diagnosis (chlamydia, gonorrhoea, syphilis or HIV) within 12 months of the index diagnosis. Model discrimination was assessed by the area under the receiver operating characteristic curve (AUC) with 95% CI. Calibration was assessed using the calibration-in-the-large statistic, calibration slope and calibration plots. Decision curve analysis evaluated net clinical benefit. Analyses used R v4.3.1. Results: The 12-month repeat STI rate was 25.1% (94/374) overall across the three validation clinics, ranging from 21.8% in Faro to 29.4% in Porto. Model discrimination was good in the pooled validation cohort (AUC 0.78, 95% CI 0.74-0.82) but varied across sites: Porto 0.81 (0.75-0.87), Coimbra 0.76 (0.69-0.83), Faro 0.72 (0.63-0.81). Calibration-in-the-large was acceptable (observed/expected ratio 1.08, 95% CI 0.91-1.27), but the calibration slope was below unity (0.82), indicating some overfitting at extreme predicted probabilities. Decision curve analysis showed positive net benefit at threshold probabilities between 10% and 40%. Kaplan-Meier analysis confirmed that patients stratified into the top risk tertile by the model had a significantly higher repeat STI rate than those in the bottom tertile (46.2% vs 15.8%; log-rank p < 0.001). Conclusion: The machine learning model maintained good discrimination for repeat STI prediction when applied to clinics outside its development setting, though calibration weakened at the extremes of predicted risk. Recalibration before clinical deployment, particularly in lower-prevalence settings, is recommended.
Language: English
Subfield: Microbiology
Open Access status: bronze
OpenAlex ID: W7204182919
FWCI:
Cites: 11
Cited by:
Related to: 9