Personalized prediction of the following-day migraine attacks: a machine learning approach based on digital headache diary records

preprint OA: closed
Full text JSON View at publisher
AI-generated deep summary by claude@2026-07, 2026-07-04 · read from full text

This prospective, multicenter study recruited 25 patients clinically diagnosed with migraine and used a three-month digital headache diary (iHeaDiary) to train supervised machine learning models (KNN, SVM, Random Forest, XGBoost) to predict whether a migraine would persist into the following day, focusing on high-frequency episodic migraine patients with 5–14 attack days per month. Using an 80/20 train-test split and evaluating accuracy-related metrics including recall and AUC, the KNN model achieved a recall of 91% and an AUC of 0.83 for following-day attack prediction. Ablation testing identified pain intensity, pain location, medication efficacy, and menstrual cycle status as the most important predictive features, and the authors report this as the first Taiwan-based prospective, real-world digital-diary approach while noting its limited sample size (and preprint status). The paper does not explicitly discuss endometriosis or adenomyosis; it was included in the corpus via a keyword match in the upstream search index.

Read from the paper's body, not the abstract. Not a substitute for reading the paper. No clinical advice. How this works

Abstract

Abstract Objective Migraine is a globally prevalent neurological disorder that significantly impacts patients' daily functioning, yet precise prediction of attacks remains challenging due to interindividual variability. The study aims to develop a personalized predictive model for forecasting the following-day migraine attacks using machine learning technique. Methods Between February and October 2023, patients with a clinical diagnosis of migraine were recruited from two medical centers to participate in a three-month prospective cohort study using a digital headache diary application. Data from a digital diary were utilized to implement supervised learning algorithms, including KNN, SVM, Random Forest, and XGBoost to predict the following-day migraine attacks. The dataset was split into 80% training and 20% testing sets, and model performance was evaluated using accuracy, recall, precision, F1-score, specificity and AUC. Results A total of 25 migraine patients with 5 to 14 monthly attack days was analyzed. The KNN model achieved a recall rate of 91% and an AUC of 0.83 for predicting the following-day migraine attacks. Moreover, based on ablation testing, the most significant predictive features identified were pain intensity, pain location, medication efficacy and menstrual cycle status. Conclusions This is the first prospective, multicenter study in Taiwan to utilize real-world digital headache diary data over a three-month period. The findings demonstrate the utility of machine learning—particularly KNN—in predicting the following-day migraine attacks based on key features such as pain intensity, menstrual cycle, medication effectiveness, and pain location. This patient-centered, data-driven approach offers a novel tool for short-term migraine prediction applicable to clinical care and self-management.
Full text 81,066 characters · extracted from preprint-html · click to expand
Personalized prediction of the following-day migraine attacks: a machine learning approach based on digital headache diary records | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Personalized prediction of the following-day migraine attacks: a machine learning approach based on digital headache diary records Ya-Hsiu Tsai, Chen-Lin Chiou, Jun-Jun Lee, Chun-Ming Yang, Kao-Chang Lin, and 2 more This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-7226289/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Objective Migraine is a globally prevalent neurological disorder that significantly impacts patients' daily functioning, yet precise prediction of attacks remains challenging due to interindividual variability. The study aims to develop a personalized predictive model for forecasting the following-day migraine attacks using machine learning technique. Methods Between February and October 2023, patients with a clinical diagnosis of migraine were recruited from two medical centers to participate in a three-month prospective cohort study using a digital headache diary application. Data from a digital diary were utilized to implement supervised learning algorithms, including KNN, SVM, Random Forest, and XGBoost to predict the following-day migraine attacks. The dataset was split into 80% training and 20% testing sets, and model performance was evaluated using accuracy, recall, precision, F1-score, specificity and AUC. Results A total of 25 migraine patients with 5 to 14 monthly attack days was analyzed. The KNN model achieved a recall rate of 91% and an AUC of 0.83 for predicting the following-day migraine attacks. Moreover, based on ablation testing, the most significant predictive features identified were pain intensity, pain location, medication efficacy and menstrual cycle status. Conclusions This is the first prospective, multicenter study in Taiwan to utilize real-world digital headache diary data over a three-month period. The findings demonstrate the utility of machine learning—particularly KNN—in predicting the following-day migraine attacks based on key features such as pain intensity, menstrual cycle, medication effectiveness, and pain location. This patient-centered, data-driven approach offers a novel tool for short-term migraine prediction applicable to clinical care and self-management. K-nearest neighbor migraine machine learning migraine disability assessment random forest Figures Figure 1 Figure 2 Figure 3 Figure 4 Introduction Migraine affects approximately 12–20% of the global population, with peak prevalence among individuals aged 25 to 55 years. Women are nearly three times more likely to suffer from migraine compared to men [ 1 – 4 ]. In addition to causing intense pain, migraine substantially impairs work productivity and quality of life. In recent years, advances in artificial intelligence (AI) have facilitated the development of systems capable of analyzing complex health data and learning adaptively to improve predictive accuracy [ 5 – 7 ]. Previous studies have demonstrated significant progress in applying machine learning (ML) techniques in migraine research [ 8 ]. These ML applications include diagnostic classification, medication overuse, triggers, and attack prediction. For example, A hybrid machine learning model integrating k-means clustering with random forest was employed in the Headache Prediction Support System (HPSS), utilizing online survey data from 614 patients and achieving 99.1% accuracy for migraine classification and 93% overall accuracy [ 9 ]. Using data from 2,162 patients collected through 75-item paper-based questionnaires, a binary XGBoost classifier was used to distinguish migraine, tension-type headache (TTH), trigeminal autonomic cephalalgias (TACs), and extracranial headache, reaching an overall accuracy of 82% [ 10 ]. A clinical decision support system based on a k-nearest neighbors (KNN) model demonstrated diagnostic accuracies of 93% for migraine and 89% for TTH [ 11 ]. A longitudinal headache classification system trained on four months of data from 32 patients, supplemented with the Migbase dataset due to limited sample size, yielded 97% classification accuracy using both SVM and KNN models [ 12 ]. In a separate study, five supervised learning algorithms applied to a Kaggle dataset achieved classification accuracies ranging from 87.5–94.2% and precision between 0.85 and 0.94 [ 13 ]. Taken together, these studies demonstrate the utility of machine learning in the classification of primary headache disorders, with several models achieving high diagnostic accuracy across diverse datasets. While some efforts have extended ML applications to risk stratification, such as identifying medication overuse headache (MOH), predictive modelling, particularly in forecasting migraine attacks, remains relatively underexplored. Notably, Risk prediction for medication overuse was addressed using a support vector machine combined with stochastic optimization techniques, based on semi-structured interview data from 777 migraine patients, with reported sensitivity of 0.69 and specificity of 0.87 [ 14 ]. In terms of migraine attack forecasting, Stubberud et al. demonstrated the Cerebri app (Nordic Brain Tech AS, Oslo, Norway) to collect daily headache diary entries and physiological data from wearable sensors over a four-week period in 18 patients. The resulting random forest model demonstrated modest predictive performance, with an area under the curve (AUC) of 0.62 [ 15 ]. Despite recent advances in digital health and AI, most prior studies on migraine focus on headache classification rather than the prediction of migraine attacks. Many of these studies have been limited by small sample sizes, single-center recruitment, and reliance on cross-sectional data derived from one-time questionnaires or databases. These limitations limit the ability to characterize the temporal dynamics and longitudinal variability of migraine. In addition, migraine is a highly heterogeneous disorder, with considerable interindividual differences in triggers, prodromal symptoms, attack frequency, and treatment responses. This variability underscores the importance of developing predictive models that are personalized rather than population-based. Yet, few studies to date have explored individualized forecasting approaches capable of addressing this complexity. To fill these gaps, we developed a personalized machine learning model to predict migraine attacks at the individual level. We collected headache-related data recorded by patients on the day of an attack using the iHeaDiary application, a digital headache diary developed by our team. We then utilized these same-day records to forecast whether the migraine would persist into the following day. By explicitly modeling individual temporal patterns, our approach improves predictive accuracy, enhances clinical relevance, and provides a scalable, low-burden tool suitable for migraine forecasting in real-world settings. Methods Study Design and Participants This study employed a prospective cohort study design. Ethical approval was obtained from the Institutional Review Board (IRB) of Chi Mei Medical Center (approval number: 11101-005) and the Chang Gung Medical Foundation IRB, Taiwan (approval number: 202300657B0C101). Participant recruitment was conducted between February and October 2023, with participants prospectively enrolled to complete a three-month digital headache diary for data collection. Eligible participants met the diagnostic criteria for migraine as defined by the International Classification of Headache Disorders, 3rd edition (ICHD-3) [ 16 , 17 ]. Additional inclusion criteria included age between 20 and 65 years and the ability to operate a mobile application. Exclusion criteria were a lack of formal migraine diagnosis or the presence of psychiatric comorbidities. All participants provided written informed consent before enrollment. Materials and Data Collection This study utilized the iHeaDiary APP, which is designed as a Progressive Web APP (PWA) integrating web-based and native application features. The APP was collaboratively designed by neurologists and based on the headache diary guidelines of the International Headache Society. It comprises nine core items, including: headache onset and end time, pain intensity, headache location, associated symptoms, presence of aura, medication use, medication effectiveness, and menstrual cycle status (Fig. 1 a). Participants were required to complete the Migraine Disability Assessment (MIDAS) and record their headache-related data daily over three months [ 18 , 19 ] (Fig. 1 b). At the end of the study, a personalized report summarizing each participant’s headache patterns was generated as illustrated in Fig. 1 c. Statistical Analysis and Data Modeling All statistical analyses and model development were carried out using Python version 3.12 within the Anaconda environment, as illustrated in Fig. 2 . Descriptive statistics were performed using the Pandas library to summarize distributions and features derived from the digital headache diary. Data preprocessing included the handling of missing and outlier values. Categorical variables were transformed using one-hot encoding to ensure compatibility with subsequent machine learning model development. 1. Data Selection and Partitioning We focused this study on patients who had 5 to 14 migraine days per month, a group defined as having high frequency episodic migraine (HFEM) [ 20 ], to develop personalized prediction models for a clinically important subgroup. These patients often experience noticeable disability due to their moderate attack frequency, but usually do not qualify for chronic migraine treatments or reimbursed preventive care. By predicting high-risk days in advance, we aimed to support early intervention, improve the timing of acute medication use, and reduce the impact of migraine attacks. We chose the HFEM group to improve the practical value and clarity of our machine learning models. HFEM patients provided enough migraine events and stable patterns over time, which made it easier to train reliable models compared to patients with fewer attacks. We excluded chronic migraine cases to avoid added complexity from conditions like medication overuse headache. This focused approach helped ensure more consistent data and supported the development of useful, personalized tools for predicting migraine attacks. To construct the predictive model, headache diary data collected over three months were used as the training input. A total of nine features were extracted: time of attack, duration, pain intensity, pain location, associated symptoms, aura, medication usage, perceived treatment efficacy, and menstrual cycle status. These features were preprocessed and converted into categorical formats suitable for machine learning, as summarized in Table 1. The dataset was randomly split into training and testing sets in an 80:20 ratio. To address class imbalance, we employed the Synthetic Minority Over-sampling Technique (SMOTE), which generates synthetic samples for the minority class to balance class distribution, thereby reducing model bias and enhancing predictive accuracy and generalization [ 21 – 23 ]. 2. Model Training and Evaluation Four supervised machine learning algorithms were employed: k-Nearest neighbors (KNN), Support Vector Machines (SVM), Random Forest, and eXtreme Gradient Boosting (XGBoost). The performance of these models in predicting the following-day migraine attacks was compared to identify the most effective approach. Model evaluation was based on standard classification metrics, including accuracy, recall, precision, F1-score, specificity, and AUC. After generating personalized prediction models for each participant, the performance metrics were aggregated and averaged across all subjects to provide an overall assessment of each algorithm’s effectiveness in predicting the following-day migraine recurrence. 3. Feature Selection To improve model performance, feature selection was conducted to eliminate redundant or weakly relevant variables while retaining the most informative features. An ablation study was performed by systematically removing individual features from the model and observing changes in performance metrics. This approach allowed us to evaluate the relative importance of each feature in contributing to predictive accuracy. Results Demographics and Three-Month Headache Diary A total of 135 patients were initially recruited and tracked using the iHeaDiary app over a three-month period. After excluding individuals with less than 5 or more than 14 headache days per month, 25 patients meeting the criteria for HFEM were included in the final analysis. Among the participants, 80% were female. The most common age group was 41–50 years (52%), followed by 51–60 years (20%), 31–40 years (16%), and 21–30 years (12%). Regarding education level, 37.8% held a university degree, 32% had a high school education or below, 12% had attended vocational school, and only 4% held a graduate degree. Based on the MIDAS, 28% were classified as having little or no disability, 8% as mild disability, 32% as moderate, and 32% as severe. The majority (88%) were employed, and only 16% were newly diagnosed patients. Demographic details are presented in Table 2. Over three months, patients experienced an average of 7.93 headache days per month, with a mean pain intensity of 3.56 (SD = 0.99). The most frequently reported pain location was side of head (49.2%; 436 episodes), followed by the back of head (20%; 177 episodes) and forehead (16.9%; 150 episodes). Less common sites included the eye socket (10.6%; 94 episodes) and face (3.3%; 29 episodes). The most common accompanying symptom was pain originating from both sides of the head (34.2%; 418 episodes). Other frequently reported symptoms included shoulder stiffness (22.2%; 272 episodes), exacerbated by physical activity (12.9%; 158 episodes), and pain relief after rest (13.5%; 166 episodes). Additionally, phonophobia (7.1%; 87 episodes), photophobia (6%; 69 episodes), nausea (3.7%; 46 episodes), and vomiting (0.4%; 5 episodes) were reported in Table 3. These findings illustrate the clinical heterogeneity of migraine symptoms and emphasize the importance of tailoring headache management and treatment strategies based on individualized symptom profiles. Personalized Prediction of the Following-Day Migraine Attacks and Feature Importance In this study, we systematically compared generalized and personalized machine learning models for predicting following-day migraine attacks. Generalized models were initially developed using pooled data from all participants. However, these models demonstrated limited predictive performance, with the highest accuracy among the four algorithms reaching only 0.65. This highlights the limitations of population-level modeling in capturing individual migraine dynamics. To address this, personalized models were constructed using individual-level data from 25 patients with high-frequency episodic migraine (HFEM). All four models demonstrated satisfactory performance in predicting the following-day migraine attacks. Among them, the KNN model (k = 3) demonstrated the best performance in predicting the following-day migraine attacks. Specifically, the model achieved the highest mean recall of 0.91 (± 0.162), indicating a strong ability to accurately identify whether a migraine attack would recur on the following day. It also achieved an overall Area Under the Curve (AUC) of 0.83 (± 0.099), reflecting excellent discriminative capability between attack and non-attack days. The random forest model showed strong performance in specificity (0.77 ± 0.184) and a relatively high AUC (0.81 ± 0.16), indicating balanced and robust performance well-suited for clinical decision-support applications. In contrast, XGBoost achieved the highest precision (0.78 ± 0.206), though its recall and F1-score were comparatively lower. In general, the KNN model demonstrated strong performance in both sensitivity and discrimination, supporting its potential as a personalized, machine learning–based prediction tool for identifying the following-day migraine recurrence. The comparative performance of generalized and personalized models across all algorithms and evaluation metrics is summarized in Table 4. To further examine model performance at the individual level, receiver operating characteristic (ROC) curves were generated for three randomly selected patients (ID 10, 55, and 127), as shown in Fig. 3 . While the AUC varied across different algorithms and patients, the KNN model consistently achieved the highest AUC values, followed by SVM and random forest. XGBoost showed the lowest AUC across all three cases. This pattern aligned with the overall model comparison results, indicating consistency and stability of algorithm performance across individuals. Based on these findings, we conducted an ablation study using the KNN model to identify the most influential features contributing to predictive accuracy. Each of the nine input features was removed individually to assess its impact on model performance, as illustrated in Fig. 4 . The exclusion of pain intensity led to the most significant decline in performance, with the AUC dropping to 0.68 ± 0.15, suggesting that this variable had the strongest predictive value for the following-day migraine attacks. Additionally, the removal of menstrual cycle status, medication effectiveness, and pain location each reduced the AUC to 0.72 ± 0.15, indicating their secondary importance in prediction. The removal of time of onset also resulted in a lower AUC (0.73 ± 0.13), further supporting its contribution to the model. Overall, the ablation results highlight several key features that significantly impact model performance. These insights may inform future feature selection strategies for individualized migraine prediction models. Discussion Previous studies have shown that applied machine learning to classify headache types [ 8 – 13 ]. This study demonstrated that a personalized machine learning model for predicting the following-day migraine attacks using longitudinal digital diary data collected from patients with HFEM over three months. Among the algorithms tested, the KNN model exhibited the highest performance, particularly in recall and AUC, reinforcing its suitability for clinical use in forecasting the following-day migraine attacks. These findings support the potential of simple, interpretable models to achieve clinically relevant predictive performance. When applied to individualized longitudinal data, such models may guide the development of real-world digital tools for migraine forecasting. Although prior studies have combined mobile diary data with wearable-derived physiological signals for migraine forecasting [ 15 ], our findings demonstrates that self-reported diary data alone are sufficient to support accurate, personalized prediction of the following-day migraine attacks. This highlights the value of scalable and low-burden data collection methods for migraine prediction in everyday clinical or consumer health settings. Furthermore, accounting for interindividual variability improves its applicability in clinical practice. This enhances the practical value of our personalized approach for anticipatory migraine care and supports its real-world implementation. Compared to conventional paper diaries, iHeaDiary app significantly reduces recall bias and fragmented reporting—common issues with retrospective surveys or single interviews that may inaccurately reflect headache frequency and severity. Feature selection through ablation analysis identified pain intensity, menstrual cycle status, medication efficacy, and the timing of migraine onset as the most influential predictive factors. These findings align with previous research [ 24 – 25 ] showing significant correlations between menstrual cycles and migraine frequency, with variations both between and within individuals. Menstrual migraines typically exhibit longer durations, greater severity of associated symptoms such as photophobia, phonophobia, and nausea, and a lower incidence of aura [ 24 – 26 ]. The integration of multidimensional clinical features allow comprehensive and immediate data capture, informing individualized and timely migraine management strategies. Limitations This study applied machine learning techniques to construct personalized models for predicting following-day migraine attacks using three months of patient-reported digital headache diary data. However, several limitations should be acknowledged. First, the model was trained exclusively on subjective self-reported data, which is inherently prone to recall bias, potentially affecting predictive accuracy. Although 135 participants were initially recruited from two medical centers, only 25 patients who experienced 5 to 14 headache days per month were included in the modeling phase, which may limit the generalizability of the findings. Future studies should aim to recruit larger, multicenter cohorts to improve model robustness. Additionally, the model did not incorporate objective physiological data, which may further constrain its predictive capability. Integrating data from wearable devices (e.g., smartwatches) to monitor real-time physiological signals could enhance the precision and reliability of future predictive models. Conclusion In conclusion, this study successfully developed a personalized model for predicting the following-day migraine attacks by integrating machine learning algorithms with longitudinal data from a digital headache diary. The results demonstrate that patient-reported data can be effectively used for accurate individualized prediction of migraine recurrence. Furthermore, ablation analysis identified pain intensity, menstrual cycle status, medication effectiveness, and time of onset as the most influential features in the model, offering clinically relevant insights for future migraine forecasting approaches. Abbreviations AI Artificial intelligence AUC Area under the curve ICHD-3 The International Classification of Headache Disorders, 3 rd edition HFEM High frequency episodic migraine IRB Institutional Review Board KNN K-nearest neighbors MIDAS Migraine Disability Assessment ML Machine learning MOH Medication overuse headache PWA Progressive Web APP SMOTE Synthetic Minority Over-sampling Technique SVM Support Vector Machines TACs Trigeminal autonomic cephalalgias TTH Tension-type headache XGBoost eXtreme Gradient Boosting Declarations Acknowledgments We would like to thank all the participants patients, without whom this study would not have been possible. Author’s contributions Y.H. Tsai: Study design, formal analysis, methodology, project administration, visualization, writing– original draft, writing– review and editing. C.L Chiou: Data curation, formal analysis, review and editing. J.J. Lee: g recruited patients and collected data. C.M. Yang: g recruited patients and collected data. K.C. Lin: Writing– review and editing. T.J. Cheng: Review and editing. C.H. Chuang: Supervision, project administration, visualization, writing– review and editing. All authors interpreted the data, reviewed the manuscript, and approved the final version. Funding The authors received no financial support for the research. Data availability The original contributions presented in the study are included in the article. Further inquiries can be directed to the authors. Ethics approval and consent to participate Ethical approval was obtained from the Institutional Review Board (IRB) of Chi Mei Medical Center (approval number: 11101-005) and the Chang Gung Medical Foundation IRB, Taiwan (approval number: 202300657B0C101) and written informed consent was obtained from all participants. Competing interests The authors declare no competing interests. References Seng EK, Martin PR, Houle TT (2022) Lifestyle factors and migraine. Lancet Neurol 21(10):911–921 Woldeamanuel YW, Cowan RP (2017) Migraine affects 1 in 10 people worldwide featuring recent rise: a systematic review and meta-analysis of community-based studies involving 6 million participants. J Neurol Sci 372:307–315 Fathima N, Babu J, Bensen J, Thomas J, Raju L (2019) Questionnaire-based study on prevalence, risk factors and disability associated with primary headache disorders. World J Pharm Res 8(11):1447–1460 Dong L, Dong W, Jin Y, Jiang Y, Li Z, Yu D (2025) The global burden of migraine: a 30-year trend review and future projections by age, sex, country, and region. Pain Ther 14(1):297–315 Ghaffar Nia N, Kaplanoglu E, Nasab A (2023) Evaluation of artificial intelligence techniques in disease diagnosis and prediction. Discov Artif Intell 3(1):5 Alowais SA, Alghamdi SS, Alsuhebany N, Alqahtani T, Alshaya AI, Almohareb SN et al (2023) Revolutionizing healthcare: the role of artificial intelligence in clinical practice. BMC Med Educ 23(1):689 Pettit RW, Fullem R, Cheng C, Amos CI (2021) Artificial intelligence, machine learning, and deep learning for clinical outcome prediction. Emerg Top Life Sci 5(6):729–745 Khan L, Shahreen M, Qazi A, Jamil Ahmed Shah S, Hussain S, Chang HT (2024) Migraine headache (MH) classification using machine learning methods with data augmentation. Sci Rep 14(1):5180 Qawasmeh A, Alhusan N, Hanandeh F, Al-Atiyat M (2020) A high performance system for the diagnosis of headache via hybrid machine learning model. Int J Adv Comput Sci Appl 11(5) Kwon J, Lee H, Cho S, Chung CS, Lee MJ, Park H (2020) Machine learning-based automated classification of headache disorders using patient-reported questionnaires. Sci Rep 10(1):14062 Yin Z, Dong Z, Lu X, Yu S, Chen X, Duan H (2015) A clinical decision support system for the diagnosis of probable migraine and probable tension-type headache based on case-based reasoning. J Headache Pain 16:1–9 Vandewiele G, De Backere F, Lannoye K, Vanden Berghe M, Janssens O, Van Hoecke S et al (2018) A decision support system to follow up and diagnose primary headache patients using semantically enriched data. BMC Med Inf Decis Mak 18:1–15 Gulati S, Guleria K, Goyal N (2022) Classification of migraine disease using supervised machine learning. In: 2022 10th International Conference on Reliability, Infocom Technologies and Optimization (ICRITO). IEEE, pp 1–7 Ferroni P, Zanzotto FM, Scarpato N, Spila A, Fofi L, Egeo G et al (2020) Machine learning approach to predict medication overuse in migraine patients. Comput Struct Biotechnol J 18:1487–1496 Stubberud A, Ingvaldsen SH, Brenner E, Winnberg I, Olsen A, Gravdahl GB et al (2023) Forecasting migraine with machine learning based on mobile phone diary and wearable data. Cephalalgia 43(5):03331024231169244 Olesen J (2018) International classification of headache disorders. Lancet Neurol 17(5):396–397 Olesen J (2024) The international classification of headache disorders: history and future perspectives. Cephalalgia 44(1):03331024231214731 Stewart WF, Lipton RB, Kolodner K (2003) Migraine disability assessment (MIDAS) score: relation to headache frequency, pain intensity, and headache symptoms. Headache 43(3):258–265 Stewart WF, Lipton RB, Whyte J, Dowson A, Kolodner K, Liberman JN et al (1999) An international study to assess reliability of the Migraine Disability Assessment (MIDAS) score. Neurology 53(5):988–988 Chalmer MA, Hansen TF, Lebedeva ER, Dodick DW, Lipton RB, Olesen J (2020) Proposed new diagnostic criteria for chronic migraine. Cephalalgia 40(4):399–406 Chawla NV, Bowyer KW, Hall LO, Kegelmeyer WP (2002) SMOTE: synthetic minority over-sampling technique. J Artif Intell Res 16:321–357 Elreedy D, Atiya AF (2019) A comprehensive analysis of synthetic minority oversampling technique (SMOTE) for handling class imbalance. Inf Sci 505:32–64 Elreedy D, Atiya AF, Kamalov F (2024) A theoretical distribution analysis of synthetic minority oversampling technique (SMOTE) for imbalanced learning. Mach Learn 113(7):4903–4923 McGinley JS, Wirth RJ, Pavlovic JM, Donoghue S, Casanova A, Lipton RB (2021) Between and within-woman differences in the association between menstruation and migraine days. Headache 61(3):430–437 MacGregor EA, Hackshaw A (2004) Prevalence of migraine on each day of the natural menstrual cycle. Neurology 63(2):351–353 Allais G, Chiarle G, Sinigaglia S, Airola G, Schiapparelli P, Benedetto C (2020) Gender-related differences in migraine. Neurol Sci 41:429–436 Tables Tables 1 to 4 are available in the Supplementary Files section. Additional Declarations No competing interests reported. Supplementary Files Table1.docx Table2.docx Table3.docx Table4.docx Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-7226289","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":492308741,"identity":"7dc8b703-5301-4eec-a8a8-77bb50943074","order_by":0,"name":"Ya-Hsiu Tsai","email":"","orcid":"","institution":"National Sun Yat-sen University","correspondingAuthor":false,"prefix":"","firstName":"Ya-Hsiu","middleName":"","lastName":"Tsai","suffix":""},{"id":492308742,"identity":"63798e10-5061-499c-a153-73bf9313f9f0","order_by":1,"name":"Chen-Lin Chiou","email":"","orcid":"","institution":"National Sun Yat-sen University","correspondingAuthor":false,"prefix":"","firstName":"Chen-Lin","middleName":"","lastName":"Chiou","suffix":""},{"id":492308743,"identity":"c3ce6870-bf70-4331-a5e6-b9cafc4b1c1f","order_by":2,"name":"Jun-Jun Lee","email":"","orcid":"","institution":"Kaohsiung Chang Gung Memorial Hospital","correspondingAuthor":false,"prefix":"","firstName":"Jun-Jun","middleName":"","lastName":"Lee","suffix":""},{"id":492308744,"identity":"0e837be1-6478-4694-9b71-e95150201d97","order_by":3,"name":"Chun-Ming Yang","email":"","orcid":"","institution":"Chi Mei Medical Center","correspondingAuthor":false,"prefix":"","firstName":"Chun-Ming","middleName":"","lastName":"Yang","suffix":""},{"id":492308745,"identity":"8f458e20-7c74-4fe8-9e5a-eb9784f679bf","order_by":4,"name":"Kao-Chang Lin","email":"","orcid":"","institution":"Chi Mei Medical Center","correspondingAuthor":false,"prefix":"","firstName":"Kao-Chang","middleName":"","lastName":"Lin","suffix":""},{"id":492308746,"identity":"8aeb3977-4e0b-40ac-b1fb-edc9cb0a5a3e","order_by":5,"name":"Tain-Junn Cheng","email":"","orcid":"","institution":"Chi Mei Medical Center","correspondingAuthor":false,"prefix":"","firstName":"Tain-Junn","middleName":"","lastName":"Cheng","suffix":""},{"id":492308747,"identity":"b67c9789-453f-4b0d-99c4-340f869235dc","order_by":6,"name":"Cheng-Hsin Chuang","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABDklEQVRIiWNgGAWjYDACCQY2MM3PjCLMRoQWyWYgcQBZCw8hLQYHiNXCP7v52WOemjt2m49zJ3/+wHDH3uD8GQOGD2WHGewlErBbcueYuTHPsWfJ2w7zbpM4wPAsccONHAPGGecOM/Dg0GIgkcMmzcN2ONkMqAXosMMJBjd4DJh524BapPFp+Xc42biZd/MHoBaww5j/EtICNNMOaPIGoMMOM244kGPAzIhHi8SNNDPJuX2HEyRAfjljcDhx5o20goM959J5eO4/wB5iM5KfSbz5dtiev//s5g8VFYft+c4f3vjgR5m1HHvPAaxaYCCxAeJOBgaFA5D4wRmTMGAPZ8k3EFI7CkbBKBgFIw0AAAQXX0BTKy6EAAAAAElFTkSuQmCC","orcid":"","institution":"National Sun Yat-sen University","correspondingAuthor":true,"prefix":"","firstName":"Cheng-Hsin","middleName":"","lastName":"Chuang","suffix":""}],"badges":[],"createdAt":"2025-07-27 12:53:16","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-7226289/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-7226289/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":88004493,"identity":"5e8742a7-a2ac-4da8-b87e-e4b538838624","added_by":"auto","created_at":"2025-07-31 10:37:24","extension":"jpg","order_by":1,"title":"Figure 1","display":"","copyAsset":false,"role":"figure","size":698866,"visible":true,"origin":"","legend":"\u003cp\u003e\u003cstrong\u003eIntroduction of the \u003c/strong\u003e\u003cem\u003e\u003cstrong\u003eiHeaDiary\u003c/strong\u003e\u003c/em\u003e\u003cstrong\u003e app\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003ea. Home page of the \u003cem\u003eiHeaDiary\u003c/em\u003e app includes migraine education and real-time symptom recording for users. b. This page enables patients to select the location of headache using a checklist. c. The visualized case report automatically generated by \u003cem\u003eiHeaDiary\u003c/em\u003e app, providing a personalized overview of the patient's migraine patterns over time.\u003c/p\u003e","description":"","filename":"Figure1.jpg","url":"https://assets-eu.researchsquare.com/files/rs-7226289/v1/46e3096889e2ac8562a94582.jpg"},{"id":88002887,"identity":"539c1a8a-87af-4b7d-b7d2-c9cc3f8237ea","added_by":"auto","created_at":"2025-07-31 10:29:24","extension":"jpg","order_by":2,"title":"Figure 2","display":"","copyAsset":false,"role":"figure","size":1533657,"visible":true,"origin":"","legend":"\u003cp\u003e\u003cstrong\u003eFlowchart of Developing Personalized Predictive Models for the Following-day Migraine Attacks\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe flowchart shows the individualized machine learning pipeline for predicting following-day migraine attacks in 25 patients. The process comprises data collection and cleaning, feature engineering, train-test split, model selection, and prediction. The performance of the prediction models across all patients was evaluated using standard classification metrics, including accuracy, recall, precision, F1 score, specificity, and AUC. Final results were obtained by averaging the performance metrics across all 25 individualized models.\u003c/p\u003e","description":"","filename":"Figure2.jpg","url":"https://assets-eu.researchsquare.com/files/rs-7226289/v1/51a26968faf1e4781609b7f3.jpg"},{"id":88004495,"identity":"18bad71c-b93a-4018-9ebe-189967ffa957","added_by":"auto","created_at":"2025-07-31 10:37:24","extension":"jpg","order_by":3,"title":"Figure 3","display":"","copyAsset":false,"role":"figure","size":246138,"visible":true,"origin":"","legend":"\u003cp\u003e\u003cstrong\u003eROC curves for different patients with migraine.\u003c/strong\u003e (a) ROC of patient 10. (b) ROC of patient 55. (c) ROC of patient 127. ROC, receive operating characteristic; AUC, area under the ROC curve\u003c/p\u003e","description":"","filename":"Figure3.jpg","url":"https://assets-eu.researchsquare.com/files/rs-7226289/v1/2f879978194a9999337630c4.jpg"},{"id":88005684,"identity":"eb836f1c-3a6b-46e5-ba18-4d4a668e9603","added_by":"auto","created_at":"2025-07-31 10:45:25","extension":"jpg","order_by":4,"title":"Figure 4","display":"","copyAsset":false,"role":"figure","size":214037,"visible":true,"origin":"","legend":"\u003cp\u003e\u003cstrong\u003eFeature Importance with KNN.\u003c/strong\u003e\u003c/p\u003e","description":"","filename":"Figure4.jpg","url":"https://assets-eu.researchsquare.com/files/rs-7226289/v1/7b3333a46b495660b52d1b09.jpg"},{"id":90350232,"identity":"d3e2aeba-ff3b-4949-8e00-034870eee668","added_by":"auto","created_at":"2025-09-01 17:31:38","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":3320577,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7226289/v1/3cf902c8-945f-4fcb-932d-2bcd5cb48b3b.pdf"},{"id":88004492,"identity":"81f82317-e548-4f3e-b165-55a81790052e","added_by":"auto","created_at":"2025-07-31 10:37:24","extension":"docx","order_by":0,"title":"","display":"","copyAsset":false,"role":"supplement","size":16635,"visible":true,"origin":"","legend":"","description":"","filename":"Table1.docx","url":"https://assets-eu.researchsquare.com/files/rs-7226289/v1/45255f1b36616d905d9d8089.docx"},{"id":88002884,"identity":"b48b8fd5-8e00-4c2e-9df4-cd5644cadc94","added_by":"auto","created_at":"2025-07-31 10:29:24","extension":"docx","order_by":1,"title":"","display":"","copyAsset":false,"role":"supplement","size":19370,"visible":true,"origin":"","legend":"","description":"","filename":"Table2.docx","url":"https://assets-eu.researchsquare.com/files/rs-7226289/v1/b807ecf973d0895d70908f7e.docx"},{"id":88002885,"identity":"8304df57-b243-48ca-93d4-15b2578a55fb","added_by":"auto","created_at":"2025-07-31 10:29:24","extension":"docx","order_by":2,"title":"","display":"","copyAsset":false,"role":"supplement","size":17069,"visible":true,"origin":"","legend":"","description":"","filename":"Table3.docx","url":"https://assets-eu.researchsquare.com/files/rs-7226289/v1/0d17a26a20dbdf1199085585.docx"},{"id":88002893,"identity":"6b436f37-2054-4fec-a1f9-71df8958aaf3","added_by":"auto","created_at":"2025-07-31 10:29:24","extension":"docx","order_by":3,"title":"","display":"","copyAsset":false,"role":"supplement","size":19482,"visible":true,"origin":"","legend":"","description":"","filename":"Table4.docx","url":"https://assets-eu.researchsquare.com/files/rs-7226289/v1/686b31870730a66ded604d61.docx"}],"financialInterests":"No competing interests reported.","formattedTitle":"Personalized prediction of the following-day migraine attacks: a machine learning approach based on digital headache diary records","fulltext":[{"header":"Introduction","content":"\u003cp\u003eMigraine affects approximately 12\u0026ndash;20% of the global population, with peak prevalence among individuals aged 25 to 55 years. Women are nearly three times more likely to suffer from migraine compared to men [\u003cspan additionalcitationids=\"CR2 CR3\" citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR4\" class=\"CitationRef\"\u003e4\u003c/span\u003e]. In addition to causing intense pain, migraine substantially impairs work productivity and quality of life. In recent years, advances in artificial intelligence (AI) have facilitated the development of systems capable of analyzing complex health data and learning adaptively to improve predictive accuracy [\u003cspan additionalcitationids=\"CR6\" citationid=\"CR5\" class=\"CitationRef\"\u003e5\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR7\" class=\"CitationRef\"\u003e7\u003c/span\u003e].\u003c/p\u003e\u003cp\u003ePrevious studies have demonstrated significant progress in applying machine learning (ML) techniques in migraine research [\u003cspan citationid=\"CR8\" class=\"CitationRef\"\u003e8\u003c/span\u003e]. These ML applications include diagnostic classification, medication overuse, triggers, and attack prediction. For example, A hybrid machine learning model integrating k-means clustering with random forest was employed in the Headache Prediction Support System (HPSS), utilizing online survey data from 614 patients and achieving 99.1% accuracy for migraine classification and 93% overall accuracy [\u003cspan citationid=\"CR9\" class=\"CitationRef\"\u003e9\u003c/span\u003e]. Using data from 2,162 patients collected through 75-item paper-based questionnaires, a binary XGBoost classifier was used to distinguish migraine, tension-type headache (TTH), trigeminal autonomic cephalalgias (TACs), and extracranial headache, reaching an overall accuracy of 82% [\u003cspan citationid=\"CR10\" class=\"CitationRef\"\u003e10\u003c/span\u003e]. A clinical decision support system based on a k-nearest neighbors (KNN) model demonstrated diagnostic accuracies of 93% for migraine and 89% for TTH [\u003cspan citationid=\"CR11\" class=\"CitationRef\"\u003e11\u003c/span\u003e]. A longitudinal headache classification system trained on four months of data from 32 patients, supplemented with the Migbase dataset due to limited sample size, yielded 97% classification accuracy using both SVM and KNN models [\u003cspan citationid=\"CR12\" class=\"CitationRef\"\u003e12\u003c/span\u003e]. In a separate study, five supervised learning algorithms applied to a Kaggle dataset achieved classification accuracies ranging from 87.5\u0026ndash;94.2% and precision between 0.85 and 0.94 [\u003cspan citationid=\"CR13\" class=\"CitationRef\"\u003e13\u003c/span\u003e]. Taken together, these studies demonstrate the utility of machine learning in the classification of primary headache disorders, with several models achieving high diagnostic accuracy across diverse datasets. While some efforts have extended ML applications to risk stratification, such as identifying medication overuse headache (MOH), predictive modelling, particularly in forecasting migraine attacks, remains relatively underexplored. Notably, Risk prediction for medication overuse was addressed using a support vector machine combined with stochastic optimization techniques, based on semi-structured interview data from 777 migraine patients, with reported sensitivity of 0.69 and specificity of 0.87 [\u003cspan citationid=\"CR14\" class=\"CitationRef\"\u003e14\u003c/span\u003e]. In terms of migraine attack forecasting, Stubberud et al. demonstrated the Cerebri app (Nordic Brain Tech AS, Oslo, Norway) to collect daily headache diary entries and physiological data from wearable sensors over a four-week period in 18 patients. The resulting random forest model demonstrated modest predictive performance, with an area under the curve (AUC) of 0.62 [\u003cspan citationid=\"CR15\" class=\"CitationRef\"\u003e15\u003c/span\u003e].\u003c/p\u003e\u003cp\u003eDespite recent advances in digital health and AI, most prior studies on migraine focus on headache classification rather than the prediction of migraine attacks. Many of these studies have been limited by small sample sizes, single-center recruitment, and reliance on cross-sectional data derived from one-time questionnaires or databases. These limitations limit the ability to characterize the temporal dynamics and longitudinal variability of migraine.\u003c/p\u003e\u003cp\u003eIn addition, migraine is a highly heterogeneous disorder, with considerable interindividual differences in triggers, prodromal symptoms, attack frequency, and treatment responses. This variability underscores the importance of developing predictive models that are personalized rather than population-based. Yet, few studies to date have explored individualized forecasting approaches capable of addressing this complexity.\u003c/p\u003e\u003cp\u003eTo fill these gaps, we developed a personalized machine learning model to predict migraine attacks at the individual level. We collected headache-related data recorded by patients on the day of an attack using the iHeaDiary application, a digital headache diary developed by our team. We then utilized these same-day records to forecast whether the migraine would persist into the following day. By explicitly modeling individual temporal patterns, our approach improves predictive accuracy, enhances clinical relevance, and provides a scalable, low-burden tool suitable for migraine forecasting in real-world settings.\u003c/p\u003e"},{"header":"Methods","content":"\u003cp\u003e\u003cb\u003eStudy Design and Participants\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThis study employed a prospective cohort study design. Ethical approval was obtained from the Institutional Review Board (IRB) of Chi Mei Medical Center (approval number: 11101-005) and the Chang Gung Medical Foundation IRB, Taiwan (approval number: 202300657B0C101). Participant recruitment was conducted between February and October 2023, with participants prospectively enrolled to complete a three-month digital headache diary for data collection.\u003c/p\u003e\u003cp\u003eEligible participants met the diagnostic criteria for migraine as defined by the International Classification of Headache Disorders, 3rd edition (ICHD-3) [\u003cspan citationid=\"CR16\" class=\"CitationRef\"\u003e16\u003c/span\u003e, \u003cspan citationid=\"CR17\" class=\"CitationRef\"\u003e17\u003c/span\u003e]. Additional inclusion criteria included age between 20 and 65 years and the ability to operate a mobile application. Exclusion criteria were a lack of formal migraine diagnosis or the presence of psychiatric comorbidities. All participants provided written informed consent before enrollment.\u003c/p\u003e\u003cp\u003e\u003cem\u003eMaterials and Data Collection\u003c/em\u003e\u003c/p\u003e\u003cp\u003eThis study utilized the iHeaDiary APP, which is designed as a Progressive Web APP (PWA) integrating web-based and native application features. The APP was collaboratively designed by neurologists and based on the headache diary guidelines of the International Headache Society. It comprises nine core items, including: headache onset and end time, pain intensity, headache location, associated symptoms, presence of aura, medication use, medication effectiveness, and menstrual cycle status (Fig.\u0026nbsp;\u003cspan refid=\"Fig1\" class=\"InternalRef\"\u003e1\u003c/span\u003ea).\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003eParticipants were required to complete the Migraine Disability Assessment (MIDAS) and record their headache-related data daily over three months [\u003cspan citationid=\"CR18\" class=\"CitationRef\"\u003e18\u003c/span\u003e, \u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e19\u003c/span\u003e] (Fig.\u0026nbsp;\u003cspan refid=\"Fig1\" class=\"InternalRef\"\u003e1\u003c/span\u003eb). At the end of the study, a personalized report summarizing each participant\u0026rsquo;s headache patterns was generated as illustrated in Fig.\u0026nbsp;\u003cspan refid=\"Fig1\" class=\"InternalRef\"\u003e1\u003c/span\u003ec.\u003c/p\u003e\u003cp\u003e\u003cb\u003eStatistical Analysis and Data Modeling\u003c/b\u003e\u003c/p\u003e\u003cp\u003eAll statistical analyses and model development were carried out using Python version 3.12 within the Anaconda environment, as illustrated in Fig.\u0026nbsp;\u003cspan refid=\"Fig2\" class=\"InternalRef\"\u003e2\u003c/span\u003e. Descriptive statistics were performed using the Pandas library to summarize distributions and features derived from the digital headache diary. Data preprocessing included the handling of missing and outlier values. Categorical variables were transformed using one-hot encoding to ensure compatibility with subsequent machine learning model development.\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003e\u003cem\u003e1. Data Selection and Partitioning\u003c/em\u003e\u003c/p\u003e\u003cp\u003eWe focused this study on patients who had 5 to 14 migraine days per month, a group defined as having high frequency episodic migraine (HFEM) [\u003cspan citationid=\"CR20\" class=\"CitationRef\"\u003e20\u003c/span\u003e], to develop personalized prediction models for a clinically important subgroup. These patients often experience noticeable disability due to their moderate attack frequency, but usually do not qualify for chronic migraine treatments or reimbursed preventive care. By predicting high-risk days in advance, we aimed to support early intervention, improve the timing of acute medication use, and reduce the impact of migraine attacks. We chose the HFEM group to improve the practical value and clarity of our machine learning models. HFEM patients provided enough migraine events and stable patterns over time, which made it easier to train reliable models compared to patients with fewer attacks. We excluded chronic migraine cases to avoid added complexity from conditions like medication overuse headache. This focused approach helped ensure more consistent data and supported the development of useful, personalized tools for predicting migraine attacks.\u003c/p\u003e\u003cp\u003eTo construct the predictive model, headache diary data collected over three months were used as the training input. A total of nine features were extracted: time of attack, duration, pain intensity, pain location, associated symptoms, aura, medication usage, perceived treatment efficacy, and menstrual cycle status. These features were preprocessed and converted into categorical formats suitable for machine learning, as summarized in Table\u0026nbsp;1. The dataset was randomly split into training and testing sets in an 80:20 ratio. To address class imbalance, we employed the Synthetic Minority Over-sampling Technique (SMOTE), which generates synthetic samples for the minority class to balance class distribution, thereby reducing model bias and enhancing predictive accuracy and generalization [\u003cspan additionalcitationids=\"CR22\" citationid=\"CR21\" class=\"CitationRef\"\u003e21\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR23\" class=\"CitationRef\"\u003e23\u003c/span\u003e].\u003c/p\u003e\u003cp\u003e\u003cem\u003e2. Model Training and Evaluation\u003c/em\u003e\u003c/p\u003e\u003cp\u003eFour supervised machine learning algorithms were employed: k-Nearest neighbors (KNN), Support Vector Machines (SVM), Random Forest, and eXtreme Gradient Boosting (XGBoost). The performance of these models in predicting the following-day migraine attacks was compared to identify the most effective approach. Model evaluation was based on standard classification metrics, including accuracy, recall, precision, F1-score, specificity, and AUC. After generating personalized prediction models for each participant, the performance metrics were aggregated and averaged across all subjects to provide an overall assessment of each algorithm\u0026rsquo;s effectiveness in predicting the following-day migraine recurrence.\u003c/p\u003e\u003cp\u003e\u003cem\u003e3. Feature Selection\u003c/em\u003e\u003c/p\u003e\u003cp\u003eTo improve model performance, feature selection was conducted to eliminate redundant or weakly relevant variables while retaining the most informative features. An ablation study was performed by systematically removing individual features from the model and observing changes in performance metrics. This approach allowed us to evaluate the relative importance of each feature in contributing to predictive accuracy.\u003c/p\u003e"},{"header":"Results","content":"\u003cp\u003e\u003cb\u003eDemographics and Three-Month Headache Diary\u003c/b\u003e\u003c/p\u003e\u003cp\u003eA total of 135 patients were initially recruited and tracked using the iHeaDiary app over a three-month period. After excluding individuals with less than 5 or more than 14 headache days per month, 25 patients meeting the criteria for HFEM were included in the final analysis. Among the participants, 80% were female. The most common age group was 41\u0026ndash;50 years (52%), followed by 51\u0026ndash;60 years (20%), 31\u0026ndash;40 years (16%), and 21\u0026ndash;30 years (12%). Regarding education level, 37.8% held a university degree, 32% had a high school education or below, 12% had attended vocational school, and only 4% held a graduate degree. Based on the MIDAS, 28% were classified as having little or no disability, 8% as mild disability, 32% as moderate, and 32% as severe. The majority (88%) were employed, and only 16% were newly diagnosed patients. Demographic details are presented in Table\u0026nbsp;2.\u003c/p\u003e\u003cp\u003eOver three months, patients experienced an average of 7.93 headache days per month, with a mean pain intensity of 3.56 (SD\u0026thinsp;=\u0026thinsp;0.99). The most frequently reported pain location was side of head (49.2%; 436 episodes), followed by the back of head (20%; 177 episodes) and forehead (16.9%; 150 episodes). Less common sites included the eye socket (10.6%; 94 episodes) and face (3.3%; 29 episodes).\u003c/p\u003e\u003cp\u003eThe most common accompanying symptom was pain originating from both sides of the head (34.2%; 418 episodes). Other frequently reported symptoms included shoulder stiffness (22.2%; 272 episodes), exacerbated by physical activity (12.9%; 158 episodes), and pain relief after rest (13.5%; 166 episodes). Additionally, phonophobia (7.1%; 87 episodes), photophobia (6%; 69 episodes), nausea (3.7%; 46 episodes), and vomiting (0.4%; 5 episodes) were reported in Table\u0026nbsp;3. These findings illustrate the clinical heterogeneity of migraine symptoms and emphasize the importance of tailoring headache management and treatment strategies based on individualized symptom profiles.\u003c/p\u003e\u003cp\u003e\u003cb\u003ePersonalized Prediction of the Following-Day Migraine Attacks and Feature Importance\u003c/b\u003e\u003c/p\u003e\u003cp\u003eIn this study, we systematically compared generalized and personalized machine learning models for predicting following-day migraine attacks. Generalized models were initially developed using pooled data from all participants. However, these models demonstrated limited predictive performance, with the highest accuracy among the four algorithms reaching only 0.65. This highlights the limitations of population-level modeling in capturing individual migraine dynamics.\u003c/p\u003e\u003cp\u003eTo address this, personalized models were constructed using individual-level data from 25 patients with high-frequency episodic migraine (HFEM). All four models demonstrated satisfactory performance in predicting the following-day migraine attacks. Among them, the KNN model (k\u0026thinsp;=\u0026thinsp;3) demonstrated the best performance in predicting the following-day migraine attacks. Specifically, the model achieved the highest mean recall of 0.91 (\u0026plusmn;\u0026thinsp;0.162), indicating a strong ability to accurately identify whether a migraine attack would recur on the following day. It also achieved an overall Area Under the Curve (AUC) of 0.83 (\u0026plusmn;\u0026thinsp;0.099), reflecting excellent discriminative capability between attack and non-attack days. The random forest model showed strong performance in specificity (0.77\u0026thinsp;\u0026plusmn;\u0026thinsp;0.184) and a relatively high AUC (0.81\u0026thinsp;\u0026plusmn;\u0026thinsp;0.16), indicating balanced and robust performance well-suited for clinical decision-support applications. In contrast, XGBoost achieved the highest precision (0.78\u0026thinsp;\u0026plusmn;\u0026thinsp;0.206), though its recall and F1-score were comparatively lower. In general, the KNN model demonstrated strong performance in both sensitivity and discrimination, supporting its potential as a personalized, machine learning\u0026ndash;based prediction tool for identifying the following-day migraine recurrence. The comparative performance of generalized and personalized models across all algorithms and evaluation metrics is summarized in Table\u0026nbsp;4.\u003c/p\u003e\u003cp\u003eTo further examine model performance at the individual level, receiver operating characteristic (ROC) curves were generated for three randomly selected patients (ID 10, 55, and 127), as shown in Fig.\u0026nbsp;\u003cspan refid=\"Fig3\" class=\"InternalRef\"\u003e3\u003c/span\u003e. While the AUC varied across different algorithms and patients, the KNN model consistently achieved the highest AUC values, followed by SVM and random forest. XGBoost showed the lowest AUC across all three cases. This pattern aligned with the overall model comparison results, indicating consistency and stability of algorithm performance across individuals.\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003eBased on these findings, we conducted an ablation study using the KNN model to identify the most influential features contributing to predictive accuracy. Each of the nine input features was removed individually to assess its impact on model performance, as illustrated in Fig.\u0026nbsp;\u003cspan refid=\"Fig4\" class=\"InternalRef\"\u003e4\u003c/span\u003e. The exclusion of pain intensity led to the most significant decline in performance, with the AUC dropping to 0.68\u0026thinsp;\u0026plusmn;\u0026thinsp;0.15, suggesting that this variable had the strongest predictive value for the following-day migraine attacks. Additionally, the removal of menstrual cycle status, medication effectiveness, and pain location each reduced the AUC to 0.72\u0026thinsp;\u0026plusmn;\u0026thinsp;0.15, indicating their secondary importance in prediction. The removal of time of onset also resulted in a lower AUC (0.73\u0026thinsp;\u0026plusmn;\u0026thinsp;0.13), further supporting its contribution to the model. Overall, the ablation results highlight several key features that significantly impact model performance. These insights may inform future feature selection strategies for individualized migraine prediction models.\u003c/p\u003e\u003cp\u003e\u003c/p\u003e"},{"header":"Discussion","content":"\u003cp\u003ePrevious studies have shown that applied machine learning to classify headache types [\u003cspan additionalcitationids=\"CR9 CR10 CR11 CR12\" citationid=\"CR8\" class=\"CitationRef\"\u003e8\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR13\" class=\"CitationRef\"\u003e13\u003c/span\u003e]. This study demonstrated that a personalized machine learning model for predicting the following-day migraine attacks using longitudinal digital diary data collected from patients with HFEM over three months. Among the algorithms tested, the KNN model exhibited the highest performance, particularly in recall and AUC, reinforcing its suitability for clinical use in forecasting the following-day migraine attacks. These findings support the potential of simple, interpretable models to achieve clinically relevant predictive performance. When applied to individualized longitudinal data, such models may guide the development of real-world digital tools for migraine forecasting.\u003c/p\u003e\u003cp\u003eAlthough prior studies have combined mobile diary data with wearable-derived physiological signals for migraine forecasting [\u003cspan citationid=\"CR15\" class=\"CitationRef\"\u003e15\u003c/span\u003e], our findings demonstrates that self-reported diary data alone are sufficient to support accurate, personalized prediction of the following-day migraine attacks. This highlights the value of scalable and low-burden data collection methods for migraine prediction in everyday clinical or consumer health settings. Furthermore, accounting for interindividual variability improves its applicability in clinical practice. This enhances the practical value of our personalized approach for anticipatory migraine care and supports its real-world implementation.\u003c/p\u003e\u003cp\u003eCompared to conventional paper diaries, iHeaDiary app significantly reduces recall bias and fragmented reporting\u0026mdash;common issues with retrospective surveys or single interviews that may inaccurately reflect headache frequency and severity. Feature selection through ablation analysis identified pain intensity, menstrual cycle status, medication efficacy, and the timing of migraine onset as the most influential predictive factors. These findings align with previous research [\u003cspan citationid=\"CR24\" class=\"CitationRef\"\u003e24\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR25\" class=\"CitationRef\"\u003e25\u003c/span\u003e] showing significant correlations between menstrual cycles and migraine frequency, with variations both between and within individuals. Menstrual migraines typically exhibit longer durations, greater severity of associated symptoms such as photophobia, phonophobia, and nausea, and a lower incidence of aura [\u003cspan additionalcitationids=\"CR25\" citationid=\"CR24\" class=\"CitationRef\"\u003e24\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR26\" class=\"CitationRef\"\u003e26\u003c/span\u003e]. The integration of multidimensional clinical features allow comprehensive and immediate data capture, informing individualized and timely migraine management strategies.\u003c/p\u003e\u003cp\u003e\u003cb\u003eLimitations\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThis study applied machine learning techniques to construct personalized models for predicting following-day migraine attacks using three months of patient-reported digital headache diary data. However, several limitations should be acknowledged. First, the model was trained exclusively on subjective self-reported data, which is inherently prone to recall bias, potentially affecting predictive accuracy. Although 135 participants were initially recruited from two medical centers, only 25 patients who experienced 5 to 14 headache days per month were included in the modeling phase, which may limit the generalizability of the findings. Future studies should aim to recruit larger, multicenter cohorts to improve model robustness.\u003c/p\u003e\u003cp\u003eAdditionally, the model did not incorporate objective physiological data, which may further constrain its predictive capability. Integrating data from wearable devices (e.g., smartwatches) to monitor real-time physiological signals could enhance the precision and reliability of future predictive models.\u003c/p\u003e"},{"header":"Conclusion","content":"\u003cp\u003eIn conclusion, this study successfully developed a personalized model for predicting the following-day migraine attacks by integrating machine learning algorithms with longitudinal data from a digital headache diary. The results demonstrate that patient-reported data can be effectively used for accurate individualized prediction of migraine recurrence. Furthermore, ablation analysis identified pain intensity, menstrual cycle status, medication effectiveness, and time of onset as the most influential features in the model, offering clinically relevant insights for future migraine forecasting approaches.\u003c/p\u003e"},{"header":"Abbreviations","content":"\u003ctable border=\"0\" cellspacing=\"0\" cellpadding=\"0\"\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003eAI\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eArtificial intelligence\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003eAUC\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eArea under the curve\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003eICHD-3\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eThe International Classification of Headache Disorders, 3\u003csup\u003erd\u003c/sup\u003e edition\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003eHFEM\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eHigh frequency episodic migraine\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003eIRB\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eInstitutional Review Board\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003eKNN \u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eK-nearest neighbors\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003eMIDAS\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eMigraine Disability Assessment\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003eML\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eMachine learning\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003eMOH\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eMedication overuse headache\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003ePWA\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eProgressive Web APP\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003eSMOTE\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eSynthetic Minority Over-sampling Technique\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003eSVM\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eSupport Vector Machines\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003eTACs\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eTrigeminal autonomic cephalalgias\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003eTTH\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eTension-type headache\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 115px;\"\u003e\n \u003cp\u003eXGBoost\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 436px;\"\u003e\n \u003cp\u003eeXtreme Gradient Boosting\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e"},{"header":"Declarations","content":"\u003cp\u003e\u003cstrong\u003eAcknowledgments\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eWe would like to thank all the participants patients, without whom this study would not have been possible.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAuthor’s contributions\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eY.H. Tsai: Study design, formal analysis, methodology, project administration, visualization, writing– original draft, writing– review and editing. C.L \u0026nbsp;Chiou:\u0026nbsp;Data curation, formal analysis, review and editing. J.J. Lee: g recruited patients and collected data. C.M. Yang:\u0026nbsp;g recruited patients and collected data. K.C. Lin:\u0026nbsp;Writing– review and editing. T.J. Cheng: Review and editing. C.H. Chuang: Supervision, project administration, visualization, writing– review and editing. All authors interpreted the data, reviewed the manuscript, and approved the final version.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eFunding\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe authors received no financial support for the research.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eData availability\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe original contributions presented in the study are included in the article. Further inquiries can be directed to the authors.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eEthics approval and consent to participate\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eEthical approval was obtained from the Institutional Review Board (IRB) of Chi Mei Medical Center (approval number: 11101-005) and the Chang Gung Medical Foundation IRB, Taiwan (approval number: 202300657B0C101) and written informed consent was obtained from all participants.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCompeting interests\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe authors declare no competing interests.\u003c/p\u003e"},{"header":"References","content":"\u003col\u003e\u003cli\u003e\u003cspan\u003eSeng EK, Martin PR, Houle TT (2022) Lifestyle factors and migraine. Lancet Neurol 21(10):911\u0026ndash;921\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eWoldeamanuel YW, Cowan RP (2017) Migraine affects 1 in 10 people worldwide featuring recent rise: a systematic review and meta-analysis of community-based studies involving 6 million participants. J Neurol Sci 372:307\u0026ndash;315\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eFathima N, Babu J, Bensen J, Thomas J, Raju L (2019) Questionnaire-based study on prevalence, risk factors and disability associated with primary headache disorders. World J Pharm Res 8(11):1447\u0026ndash;1460\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eDong L, Dong W, Jin Y, Jiang Y, Li Z, Yu D (2025) The global burden of migraine: a 30-year trend review and future projections by age, sex, country, and region. Pain Ther 14(1):297\u0026ndash;315\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eGhaffar Nia N, Kaplanoglu E, Nasab A (2023) Evaluation of artificial intelligence techniques in disease diagnosis and prediction. Discov Artif Intell 3(1):5\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eAlowais SA, Alghamdi SS, Alsuhebany N, Alqahtani T, Alshaya AI, Almohareb SN et al (2023) Revolutionizing healthcare: the role of artificial intelligence in clinical practice. BMC Med Educ 23(1):689\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003ePettit RW, Fullem R, Cheng C, Amos CI (2021) Artificial intelligence, machine learning, and deep learning for clinical outcome prediction. Emerg Top Life Sci 5(6):729\u0026ndash;745\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eKhan L, Shahreen M, Qazi A, Jamil Ahmed Shah S, Hussain S, Chang HT (2024) Migraine headache (MH) classification using machine learning methods with data augmentation. Sci Rep 14(1):5180\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eQawasmeh A, Alhusan N, Hanandeh F, Al-Atiyat M (2020) A high performance system for the diagnosis of headache via hybrid machine learning model. Int J Adv Comput Sci Appl 11(5)\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eKwon J, Lee H, Cho S, Chung CS, Lee MJ, Park H (2020) Machine learning-based automated classification of headache disorders using patient-reported questionnaires. Sci Rep 10(1):14062\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eYin Z, Dong Z, Lu X, Yu S, Chen X, Duan H (2015) A clinical decision support system for the diagnosis of probable migraine and probable tension-type headache based on case-based reasoning. J Headache Pain 16:1\u0026ndash;9\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eVandewiele G, De Backere F, Lannoye K, Vanden Berghe M, Janssens O, Van Hoecke S et al (2018) A decision support system to follow up and diagnose primary headache patients using semantically enriched data. BMC Med Inf Decis Mak 18:1\u0026ndash;15\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eGulati S, Guleria K, Goyal N (2022) Classification of migraine disease using supervised machine learning. In: 2022 10th International Conference on Reliability, Infocom Technologies and Optimization (ICRITO). IEEE, pp 1\u0026ndash;7\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eFerroni P, Zanzotto FM, Scarpato N, Spila A, Fofi L, Egeo G et al (2020) Machine learning approach to predict medication overuse in migraine patients. Comput Struct Biotechnol J 18:1487\u0026ndash;1496\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eStubberud A, Ingvaldsen SH, Brenner E, Winnberg I, Olsen A, Gravdahl GB et al (2023) Forecasting migraine with machine learning based on mobile phone diary and wearable data. Cephalalgia 43(5):03331024231169244\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eOlesen J (2018) International classification of headache disorders. Lancet Neurol 17(5):396\u0026ndash;397\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eOlesen J (2024) The international classification of headache disorders: history and future perspectives. Cephalalgia 44(1):03331024231214731\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eStewart WF, Lipton RB, Kolodner K (2003) Migraine disability assessment (MIDAS) score: relation to headache frequency, pain intensity, and headache symptoms. Headache 43(3):258\u0026ndash;265\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eStewart WF, Lipton RB, Whyte J, Dowson A, Kolodner K, Liberman JN et al (1999) An international study to assess reliability of the Migraine Disability Assessment (MIDAS) score. Neurology 53(5):988\u0026ndash;988\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eChalmer MA, Hansen TF, Lebedeva ER, Dodick DW, Lipton RB, Olesen J (2020) Proposed new diagnostic criteria for chronic migraine. Cephalalgia 40(4):399\u0026ndash;406\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eChawla NV, Bowyer KW, Hall LO, Kegelmeyer WP (2002) SMOTE: synthetic minority over-sampling technique. J Artif Intell Res 16:321\u0026ndash;357\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eElreedy D, Atiya AF (2019) A comprehensive analysis of synthetic minority oversampling technique (SMOTE) for handling class imbalance. Inf Sci 505:32\u0026ndash;64\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eElreedy D, Atiya AF, Kamalov F (2024) A theoretical distribution analysis of synthetic minority oversampling technique (SMOTE) for imbalanced learning. Mach Learn 113(7):4903\u0026ndash;4923\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eMcGinley JS, Wirth RJ, Pavlovic JM, Donoghue S, Casanova A, Lipton RB (2021) Between and within-woman differences in the association between menstruation and migraine days. Headache 61(3):430\u0026ndash;437\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eMacGregor EA, Hackshaw A (2004) Prevalence of migraine on each day of the natural menstrual cycle. Neurology 63(2):351\u0026ndash;353\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eAllais G, Chiarle G, Sinigaglia S, Airola G, Schiapparelli P, Benedetto C (2020) Gender-related differences in migraine. Neurol Sci 41:429\u0026ndash;436\u003c/span\u003e\u003c/li\u003e\u003c/ol\u003e"},{"header":"Tables","content":"\u003cp\u003eTables 1 to 4 are available in the Supplementary Files section.\u003c/p\u003e"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"K-nearest neighbor, migraine, machine learning, migraine disability assessment, random forest","lastPublishedDoi":"10.21203/rs.3.rs-7226289/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-7226289/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003ch2\u003eObjective\u003c/h2\u003e\u003cp\u003eMigraine is a globally prevalent neurological disorder that significantly impacts patients' daily functioning, yet precise prediction of attacks remains challenging due to interindividual variability. The study aims to develop a personalized predictive model for forecasting the following-day migraine attacks using machine learning technique.\u003c/p\u003e\u003ch2\u003eMethods\u003c/h2\u003e\u003cp\u003eBetween February and October 2023, patients with a clinical diagnosis of migraine were recruited from two medical centers to participate in a three-month prospective cohort study using a digital headache diary application. Data from a digital diary were utilized to implement supervised learning algorithms, including KNN, SVM, Random Forest, and XGBoost to predict the following-day migraine attacks. The dataset was split into 80% training and 20% testing sets, and model performance was evaluated using accuracy, recall, precision, F1-score, specificity and AUC.\u003c/p\u003e\u003ch2\u003eResults\u003c/h2\u003e\u003cp\u003eA total of 25 migraine patients with 5 to 14 monthly attack days was analyzed. The KNN model achieved a recall rate of 91% and an AUC of 0.83 for predicting the following-day migraine attacks. Moreover, based on ablation testing, the most significant predictive features identified were pain intensity, pain location, medication efficacy and menstrual cycle status.\u003c/p\u003e\u003ch2\u003eConclusions\u003c/h2\u003e\u003cp\u003eThis is the first prospective, multicenter study in Taiwan to utilize real-world digital headache diary data over a three-month period. The findings demonstrate the utility of machine learning\u0026mdash;particularly KNN\u0026mdash;in predicting the following-day migraine attacks based on key features such as pain intensity, menstrual cycle, medication effectiveness, and pain location. This patient-centered, data-driven approach offers a novel tool for short-term migraine prediction applicable to clinical care and self-management.\u003c/p\u003e","manuscriptTitle":"Personalized prediction of the following-day migraine attacks: a machine learning approach based on digital headache diary records","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-07-31 10:29:19","doi":"10.21203/rs.3.rs-7226289/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"2f7550c8-f9bd-44e1-87eb-e359c550cbbc","owner":[],"postedDate":"July 31st, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2025-09-01T17:23:30+00:00","versionOfRecord":[],"versionCreatedAt":"2025-07-31 10:29:19","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-7226289","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-7226289","identity":"rs-7226289","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00