An optimized machine learning algorithm successfully forecasted the occurrence of next-day migraine attacks, with patient-reported headache severity over the preceding 30 days serving as the most influential predictive factor.
A machine learning (ML) model using longitudinal electronic headache diary data accurately predicted next-day migraine occurrence, according to study results published in Neurology Open Access.
Previous efforts to forecast migraine using electronic diary and other patient-generated data have had limited predictive performance. Researchers therefore evaluated whether ML models incorporating headache patterns over periods as long as 30 days could improve next-day migraine prediction.
The researchers analyzed prospectively collected data from patients with migraine who were prescribed a remote electrical neuromodulation device and used the accompanying mobile application, Nerivio, between January 2020 and July 2025. The researchers evaluated electronic diary and pretreatment questionnaire data on headache severity, functional impairment, medication use, aura, and prodromal symptoms, as well as demographic and location-based weather information. Multiple ML approaches were assessed using variables characterizing migraine activity across 3-, 7-, 14-, and 30-day periods.
The findings indicate that the most informative signals come from patterns of headache severity and attack frequency collected over the 30 days preceding an attack…
Of 58,863 individuals who entered symptom information during the study period, 53,065 met eligibility criteria. Participants had a mean age of 43.04 years, 83.73% were women, and 87.50% were adults. Most participants (88.87%) were located in the US.
The analysis included 770,473 eligible target days, including 532,822 (69.15%) migraine days and 237,651 (30.85%) nonmigraine days. Aura was reported with 22.39% of migraine attacks.
The optimized Extreme Gradient Boosting (XGBoost) model achieved a precision of 0.912, accuracy of 0.810, sensitivity of 0.800, specificity of 0.830, and area under the curve (AUC) of 0.893. Its score for balancing correctly predicted migraine days with incorrectly predicted migraine days was 0.852. The random forest model had the highest individual accuracy (0.816) and sensitivity (0.909), but its specificity was 0.613.
Features representing the preceding 30 days accounted for 56.34% of model contribution, compared with 4.38% for current-day information. Mean headache severity across the previous 30 days was the most influential individual predictor, accounting for 37.64% of model gain. Migraine density over the prior 7 days contributed 9.56%, followed by the longest migraine-day streak during the prior 3 days at 5.58%. By clinical domain, headache severity contributed 45.05% of model gain and temporal migraine patterns contributed 32.46%.
There were no significant differences in model performance by sex (P =.42) or between individuals aged 8 to 18 years and those older than 18 years (P =.28).
Study limitations include missing information on factors such as sleep, stress, and dietary habits. There was also a higher proportion of migraine-day reports than nonmigraine-day reports,
“The findings indicate that the most informative signals come from patterns of headache severity and attack frequency collected over the 30 days preceding an attack, attesting to the critical role of long-term patterns in estimating the likelihood of future attacks,” the study authors concluded.
Disclosures: Multiple study authors declared affiliations with biotech, pharmaceutical, and/or device companies. Please see the original reference for a full list of disclosures.
Rabany L, Markina A, Cowan RP, et al.Machine learning assessment of next-day migraine likelihood using data from 53,000 app users living with migraine.Neurol Open Access.2026;2(3):e000144. doi:10.1212/WN9.0000000000000144
