Development and validation of a machine learning model for predicting postherpetic neuralgia risk
Xiao Chen1, Xinqiang Lin1, Chaoyue Lin2
1Department of Pain Medicine, The Affiliated Hospital of Putian University, Putian, China.
Frontiers in Neurology
|May 4, 2026
Summary
Machine learning models can predict postherpetic neuralgia (PHN) risk after herpes zoster (HZ) onset. The XGBoost model, using factors like age and antiviral timing, shows high accuracy for early patient stratification.
Area of Science:
- Computational medicine
- Epidemiology
- Machine learning in healthcare
Background:
- Postherpetic neuralgia (PHN) is a significant complication of herpes zoster (HZ).
- Early identification of patients at high risk for PHN is crucial for effective intervention.
- Developing predictive models can aid in timely clinical management.
Purpose of the Study:
- To develop and validate machine learning (ML) models for predicting PHN risk following HZ onset.
- To identify key clinical factors associated with PHN development.
- To create a tool for early risk stratification of HZ patients.
Main Methods:
- Retrospective analysis of two prospective cohorts (n=627 training, n=219 validation).
- Feature selection using LASSO regression and Boruta algorithm.
- Development and evaluation of ten ML models using AUC, accuracy, sensitivity, F1 score, calibration, and clinical utility.
- Model interpretation via SHapley Additive exPlanations (SHAP).
Main Results:
- PHN incidence was 19.0% in the training cohort and 22.8% in the validation cohort.
- Five key risk factors identified: age, timing of antiviral therapy, acute pain severity, prodromal pain, and diabetes.
- XGBoost model demonstrated superior performance with AUCs of 0.826 (training) and 0.840 (validation).
- SHAP analysis confirmed age as the most significant predictor.
Conclusions:
- The XGBoost model effectively predicts PHN risk using five accessible clinical factors.
- This ML tool facilitates early risk stratification for HZ patients.
- The model supports personalized management strategies for preventing PHN.


