AUTHOR=Mora Toni , Roche David , Muñoz-Cano Rosa TITLE=Predicting first-time anaphylaxis in the elderly using stacked machine learning and population registers JOURNAL=Frontiers in Allergy VOLUME=Volume 6 - 2025 YEAR=2025 URL=https://www.frontiersin.org/journals/allergy/articles/10.3389/falgy.2025.1655662 DOI=10.3389/falgy.2025.1655662 ISSN=2673-6101 ABSTRACT=BackgroundAnaphylaxis is a severe, potentially life-threatening allergic reaction that requires rapid identification and intervention. Predicting individuals at risk remains a clinical challenge due to its multifactorial nature and variable presentation.ObjectiveTo develop and evaluate explainable machine learning models that predict the risk of anaphylaxis using routinely collected clinical data.MethodsWe analysed a matched case-control dataset derived from anonymised electronic health records. After applying chi-squared-based feature selection, we trained multiple classification algorithms—including logistic regression, decision trees, random forests, XGBoost, and a stacking ensemble. Model performance was evaluated using AUC, sensitivity, specificity, precision, and F1-score. SHAP values were used to assess model explainability.ResultsThe best-performing model achieved an AUC of 0.79, demonstrating high discrimination and balanced sensitivity/specificity. Key predictors included healthcare utilisation patterns, age, socioeconomic proxy (copayment level), and specific diagnostic codes related to allergic conditions.ConclusionThis study demonstrates the potential of interpretable machine learning approaches to support the early identification of individuals at high risk of anaphylaxis. These tools can enhance clinical risk stratification and inform preventive strategies in routine practice.