Explainable XGBoost Modeling of Quality of Life Among Patients with Fibromyalgia Using Pain, Sleep, and Psychological Flexibility Variables
Keywords:
Fibromyalgia, Quality of Life, XGBoost, Explainable Artificial Intelligence, Pain Intensity, Sleep Quality, Psychological FlexibilityAbstract
Objective: This study aimed to develop and interpret an explainable XGBoost model for predicting quality of life among patients with fibromyalgia based on pain intensity, sleep quality, psychological flexibility, and relevant demographic and clinical variables.
Methods and Materials: This cross-sectional predictive modeling study was conducted among 318 patients with fibromyalgia receiving services from rheumatology and pain management clinics in Tehran, Iran. Data were collected using a demographic and clinical information form, the Short Form Health Survey for quality of life, the Visual Analog Scale for pain intensity, the Pittsburgh Sleep Quality Index for sleep quality, and the Acceptance and Action Questionnaire-II for psychological flexibility. After data screening and preprocessing, quality of life was considered the continuous outcome variable. Predictive modeling was performed using XGBoost regression, and model performance was compared with linear regression, support vector regression, and random forest regression. Model accuracy was evaluated using mean absolute error, root mean square error, coefficient of determination, and cross-validation. SHAP analysis was used to explain the final XGBoost model.
Findings: Correlation analysis showed that quality of life was significantly and negatively associated with pain intensity (r = -0.58, p < 0.01) and poor sleep quality (r = -0.52, p < 0.01), while it was significantly and positively associated with psychological flexibility (r = 0.49, p < 0.01). The XGBoost model demonstrated the strongest predictive performance, with a test MAE of 7.84, test RMSE of 10.18, test R² of 0.66, and cross-validated R² of 0.63. SHAP analysis identified pain intensity as the most influential predictor, followed by poor sleep quality and psychological flexibility.
Conclusion: The findings indicated that quality of life among patients with fibromyalgia can be predicted with acceptable accuracy using an explainable XGBoost model, with pain intensity, sleep quality, and psychological flexibility emerging as the most important predictors.
Downloads
References
Ablin, J. N., & Sarzi‐Puttini, P. (2024). The 6th International Congress on Controversies in Fibromyalgia. Clinical and Experimental Rheumatology. https://doi.org/10.55563/clinexprheumatol/jbprfx
Ana Cecília Rosatelli de Freitas, B., Vilarino, G. T., Souza, L. C. d., Dominski, F. H., Branco, J. H. L., & Andrade, A. (2023). Effects of Resistance Training on Sleep of Patients With Fibromyalgia: A Systematic Review. Journal of Health Psychology, 28(11), 1072-1084. https://doi.org/10.1177/13591053231172288
Anagnostopoulos, F., Paraponiari, A., & Kafetsios, K. (2022). The Role of Pain Catastrophizing, Emotional Intelligence, and Pain Intensity in the Quality of Life of Cancer Patients With Chronic Pain. Journal of Clinical Psychology in Medical Settings, 30(3), 501-519. https://doi.org/10.1007/s10880-022-09921-5
Araya‐Quintanilla, F., Cuyúl-Vásquez, I., Lizama-Lefno, A., Jeria-Diaz, A., Fuentes, J., Serrat, M., & Gutiérrez‐Espinoza, H. (2025). Effectiveness of Multicomponent Treatment Compared With Other Therapeutic Interventions in Patients With Fibromyalgia: A Systematic Review With Meta-Analysis. Journal of Back and Musculoskeletal Rehabilitation, 38(6), 1209-1231. https://doi.org/10.1177/10538127251337393
Carlson, L. E., Baydoun, M., & Flynn, M. (2025). Emerging Integrative Medicine Approaches to Disease Management. 145-170. https://doi.org/10.1037/0000395-008
Clark, N., Johnson, M., Rangan, A., Kottam, L., & Swainston, K. (2023). The Biopsychosocial Impact of Hypermobility Spectrum Disorders in Adults: A Scoping Review. Rheumatology International, 43(6), 985-1014. https://doi.org/10.1007/s00296-023-05298-2
Cojocaru, C., Popa, C. O., Schenk, A., Suciu, B. A., & Szasz, S. (2023). Cognitive-Behavioral Therapy and Acceptance and Commitment Therapy for Anxiety and Depression in Patients With Fibromyalgia: A Systematic Review and Meta-Analysis. Medicine and Pharmacy Reports, 97(1), 26-34. https://doi.org/10.15386/mpr-2661
D’Andre, S. D., Kirsch, J. L., Montane, H. N., Kruger, M. B., Donovan, K. A., Bronars, C., Markovic, S. N., & Ehlers, S. L. (2024). Cancer and Stress: Understanding the Connections and Interventions. American Journal of Lifestyle Medicine, 19(8), 1193-1215. https://doi.org/10.1177/15598276241304373
Devigili, G., Stefano, G. D., Donadio, V., Frattale, I., Grazzi, L., Mantovani, E., Nolano, M., Provitera, V., Quitadamo, S. G., Tamburin, S., Truini, A., Valeriani, M., Furia, A., Vecchio, E., Fischetti, F., Greco, G., Telesca, A., & Tommaso, M. d. (2025). Therapeutic Approach to Fibromyalgia: A Consensus Statement on Pharmacological and Non-Pharmacological Treatment From the Neuropathic Pain Special Interest Group of the Italian Neurological Society. Neurological Sciences, 46(5), 2263-2288. https://doi.org/10.1007/s10072-025-08048-3
Donisi, V., Lucia, A. D., Pasini, I., Gandolfi, M., Schweiger, V., Piccolo, L. D., & Perlini, C. (2023). E-Health Interventions Targeting Pain-Related Psychological Variables in Fibromyalgia: A Systematic Review. Healthcare, 11(13), 1845. https://doi.org/10.3390/healthcare11131845
Fang, S., & Ding, D. (2022). Which Outcome Variables Are Associated With Psychological Inflexibility/Flexibility for Chronic Pain Patients? A Three Level Meta-Analysis. Frontiers in psychology, 13. https://doi.org/10.3389/fpsyg.2022.1069748
Foustoukos, T. L., Blanchard, M., & Hügle, T. (2024). Evidence-Based Self-Management Strategies for Fibromyalgia: Foundations for Digital Therapeutic Applications (Preprint). https://doi.org/10.2196/preprints.67523
Gallego, A., Serrat, M., Royuela-Colomer, E., Sanabria‐Mazo, J. P., Borràs, X., Esteve, M., Grasa, M., Rosa, A., Rozadilla‐Sacanell, A., Almirall, M., D’Amico, F., Dai, Y., Rosenbluth, M., McCracken, L. M., Navarrete, J., Feliu‐Soler, A., & Luciano, J. V. (2024). Study Protocol for a Three-Arm Randomized Controlled Trial Investigating the Effectiveness, Cost-Utility, and Physiological Effects of a Fully Self-Guided Digital Acceptance and Commitment Therapy for Spanish Patients With Fibromyalgia. Digital Health, 10. https://doi.org/10.1177/20552076241239177
Galvez-Sánchez, C. M., Montoro, C. I., Moreno‐Padilla, M., Gustavo, A. R. d. P., & Coba, P. d. l. (2021). Effectiveness of Acceptance and Commitment Therapy in Central Pain Sensitization Syndromes: A Systematic Review. Journal of clinical medicine, 10(12), 2706. https://doi.org/10.3390/jcm10122706
García‐Torres, F., García‐Carmona, M., Moreno, E. M., Jurado-González, F., & Aguilera‐Martín, Á. (2024). Internet-Delivered Acceptance and Commitment Therapy for Cancer Patients and Survivors: A Systematic Review. Sage Open, 14(4). https://doi.org/10.1177/21582440241297591
Gordon, S., Brown, R., Hogan, M. K., & Menzies, V. (2022). Mindfulness as a Symptom Management Strategy for Fibromyalgia: An Integrative Review. Journal of Holistic Nursing, 41(2), 200-214. https://doi.org/10.1177/08980101221123833
Islam, Z., D’Silva, A., Raman, M., & Nasser, Y. (2022). The Role of Mind Body Interventions in the Treatment of Irritable Bowel Syndrome and Fibromyalgia. Frontiers in Psychiatry, 13. https://doi.org/10.3389/fpsyt.2022.1076763
Jiang, X., Sun, J., Song, R., Wang, Y., Li, J., & Shi, R. (2024). Acceptance and Commitment Therapy Reduces Psychological Distress in Patients With Cancer: A Systematic Review and Meta-Analysis of Randomized Controlled Trials. Frontiers in psychology, 14. https://doi.org/10.3389/fpsyg.2023.1253266
Kiefer, D., Sonkaya, Y., Krause, D., Voglau, M., Mintrop, B., Redeker, I., Baraliakos, X., & Kiltz, U. (2025). Digital Behavioral Therapy Improves Outcome in Patients With Axial Spondyloarthritis and Persistent Pain: A Randomized Controlled Trial. Arthritis care & research, 78(1), 85-95. https://doi.org/10.1002/acr.25679
Kundakci, B., Kaur, J., Goh, S. L., Hall, M., Doherty, M., Zhang, W., & Abhishek, A. (2021). Efficacy of Nonpharmacological Interventions for Individual Features of Fibromyalgia: A Systematic Review and Meta-Analysis of Randomised Controlled Trials. Pain, 163(8), 1432-1445. https://doi.org/10.1097/j.pain.0000000000002500
Luciano, J. V., Neblett, R., Peñacoba, C., Suso‐Ribera, C., & McCracken, L. M. (2023). The Contribution of the Psychologist in the Assessment and Treatment of Fibromyalgia. Current Treatment Options in Rheumatology, 9(2), 11-31. https://doi.org/10.1007/s40674-023-00200-4
McCracken, L. M., Yu, L., & Vowles, K. E. (2022). New Generation Psychological Treatments in Chronic Pain. bmj, 376, e057212. https://doi.org/10.1136/bmj-2021-057212
Mueller, C., Thomas, A., Amara, A. W., DeWolfe, J., & Thomas, S. J. (2024). Effects of Exercise on Sleep in Patients With Epilepsy: A Systematic Review. Epilepsy & Behavior Reports, 26, 100675. https://doi.org/10.1016/j.ebr.2024.100675
Pathak, A., Rai, J., Singh, R., & Bhatt, G. C. (2023). Effectiveness of Rehabilitation Strategies in Primary Fibromyalgia Syndrome: A Systematic Review and Meta-Analysis. British Journal of Pain, 17(4), 375-399. https://doi.org/10.1177/20494637231168021
Pilar Martínez Narváez-Cabeza de, V., Sánchez, A. I., Prados, G., Lami, M. J., Villar, B., & Miró, E. (2021). Fibromyalgia as a Heterogeneous Condition: Subgroups of Patients Based on Physical Symptoms and Cognitive-Affective Variables Related to Pain. The Spanish journal of psychology, 24. https://doi.org/10.1017/sjp.2021.30
Pino‐Sedeño, T. d., Cabrera-Maroto, M., Abrante-Luis, A., González‐Hernández, Y., & Herrera, M. G. (2024). Effectiveness of Psychological Interventions in Endometriosis: A Systematic Review With Meta-Analysis. Frontiers in psychology, 15. https://doi.org/10.3389/fpsyg.2024.1457842
Rickardsson, J., Gentili, C., Holmström, L., Zetterqvist, V., Andersson, E., Persson, J., Lekander, M., Ljótsson, B., & Wicksell, R. K. (2021). Internet‐delivered Acceptance and Commitment Therapy as Microlearning for Chronic Pain: A Randomized Controlled Trial With 1‐year Follow‐up. European Journal of Pain, 25(5), 1012-1030. https://doi.org/10.1002/ejp.1723
Salari, N., Khazaie, H., Hosseinian‐Far, A., Khaledi‐Paveh, B., Ghasemi, H., Mohammadi, M., & Shohaimi, S. (2020). The Effect of Acceptance and Commitment Therapy on Insomnia and Sleep Quality: A Systematic Review. BMC Neurology, 20(1). https://doi.org/10.1186/s12883-020-01883-1
Serdarević, M. (2024). Chronic Pain Psychology in Neurology Practice. Continuum Lifelong Learning in Neurology, 30(5), 1501-1516. https://doi.org/10.1212/con.0000000000001471
Silva, L. C. d., Dittgen, M., Meroni, R., Romero, E. A. S., Rossettini, G., Villafañe, J. H., & Corbellini, C. (2024). Exercise Training for Women With Fibromyalgia Syndrome. Topics in Geriatric Rehabilitation, 40(2), 147-157. https://doi.org/10.1097/tgr.0000000000000435
Sipilä, R., & Kalso, E. (2021). Sleep Well and Recover Faster With Less Pain—A Narrative Review on Sleep in the Perioperative Period. Journal of clinical medicine, 10(9), 2000. https://doi.org/10.3390/jcm10092000
Wang, Y., Aaron, R. V., Attal, N., & Colloca, L. (2025). An Update on Non-Pharmacological Interventions for Pain Relief. Cell Reports Medicine, 6(2), 101940. https://doi.org/10.1016/j.xcrm.2025.101940
Whale, K., Dennis, J. A., Wylde, V., Beswick, A. D., & Gooberman‐Hill, R. (2022). The Effectiveness of Non-Pharmacological Sleep Interventions for People With Chronic Pain: A Systematic Review and Meta-Analysis. BMC Musculoskeletal Disorders, 23(1). https://doi.org/10.1186/s12891-022-05318-5
Wiklund, T. (2021). Insomnia Symptoms in Chronic Pain : Clinical Presentation, Risk and Treatment. https://doi.org/10.3384/diss.diva-175373
Wu, Y.-Q., Long, Y., Peng, W., Gong, C., Liu, Y.-Q., Peng, X.-M., Zhong, Y.-B., Luo, Y., & Wang, M. (2023). The Efficacy and Safety of Telerehabilitation for Fibromyalgia: Systematic Review and Meta-Analysis of Randomized Controlled Trials. Journal of medical Internet research, 25, e42090. https://doi.org/10.2196/42090
Downloads
Published
Submitted
Revised
Accepted
Issue
Section
License
Copyright (c) 2026 Khadijeh Irandoust, Morteza Taheri (Author)

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.