ORIGINAL RESEARCH article
Front. Allergy
Sec. Drug, Venom & Anaphylaxis
Volume 6 - 2025 | doi: 10.3389/falgy.2025.1655662
Predicting First-Time Anaphylaxis in the Elderly Using Stacked Machine Learning and Population Registers
Provisionally accepted- 1International University of Catalonia, Barcelona, Spain
- 2Universitat Internacional de Catalunya, Barcelona, Spain
- 3Hospital Clinic de Barcelona, Barcelona, Spain
Select one of your emails
You have multiple emails registered with Frontiers:
Notify me on publication
Please enter your email address:
If you already have an account, please login
You don't have a Frontiers account ? You can register here
Abstract Background: Anaphylaxis 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. Objective: To develop and evaluate explainable machine learning models that predict the risk of anaphylaxis using routinely collected clinical data. Methods: We 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. Results: The 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. Conclusion: This 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.
Keywords: Anaphylaxis Prediction, Stacked Machine Learning Model, Administrative healthcare data, elderly population, Healthcare Utilisation Patterns, artificial intelligence, Allergy Risk Stratification
Received: 28 Jun 2025; Accepted: 10 Oct 2025.
Copyright: © 2025 Mora, Roche and Muñoz Cano. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) or licensor are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.
* Correspondence: Toni Mora, tmora@uic.es
Disclaimer: All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.