# Quality of life analysis in community pharmacy using deep learning and explainability methods

**Authors:** María José Reyes-Medina, María Del Pilar Carrera-González, Vanesa Cantón-Habas, J L Ávila-Jiménez

PMC · DOI: 10.1093/jamiaopen/ooag012 · JAMIA Open · 2026-01-30

## TL;DR

This study uses deep learning and explainability methods in community pharmacies to identify factors affecting quality of life in chronic disease patients.

## Contribution

The novel use of deep learning and explainability tools in community pharmacy data to identify key quality-of-life factors in chronic disease patients.

## Key findings

- The FCNN ensemble model outperformed tree-based models in predicting quality of life.
- SHAP and LIME identified pain, mobility limitations, and beta-blocker use as key factors.
- Community pharmacies are effective for collecting and applying predictive tools in chronic disease management.

## Abstract

The study aimed to develop a deep learning-based model, using global and local explainability methods, to process clinical data collected in community pharmacies and identify the key variables influence health-related quality of life in patients with chronic diseases.

Data from 347 chronic patients, including 257 variables, were analyzed. Five predictive models were compared using 10-way stratified cross-validation: Gradient Boosting, Random Forest, LightGBM, a fully connected neural network (FCNN), and a set of 5 FCNNs. For interpretability, SHapley Additive exPlanations (SHAP) was used for the global importance of variables and Local Interpretable Model-Agnostic Explanations (LIME) for the local interpretation of individual cases.

The FCNN ensemble achieved the best performance (R2 = 0.511 ± 0.126; 95% CI: 0.385-0.637; Mean Absolute Error = 0.0819 ± 0.0088; Mean Squared Error = 0.0122 ± 0.0039). Tree-based models showed slightly lower performance (eg, Gradient Boosting R2 = 0.484 ± 0.113). Explainability analysis identified pain, mobility limitations, beta-blocker use, anxiety/depression symptoms, and difficulties with activities of daily living as the most influential variables.

The findings highlight that deep learning models can capture complex relationships among multiple clinical and psychosocial variables. The combination of SHAP and LIME allows for clinically interpretable results, facilitating personalized decisions in chronic disease care. Furthermore, the accessibility of community pharmacies provides a practical setting for data collection and application of these predictive tools.

The study demonstrates the potential of machine learning to support personalized decision-making in the management of chronic diseases from accessible settings such as community pharmacies, identifying the most important factors affecting patients’ quality of life.

## Full-text entities

- **Diseases:** pain (MESH:D010146), anxiety (MESH:D001007), depression (MESH:D003866)
- **Species:** Homo sapiens (human, species) [taxon 9606]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12863085/full.md

## Figures

2 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12863085/full.md

## References

77 references — full list in the complete paper: https://tomesphere.com/paper/PMC12863085/full.md

---
Source: https://tomesphere.com/paper/PMC12863085