Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Jun 2:13:1574531.
doi: 10.3389/fpubh.2025.1574531. eCollection 2025.

Machine learning-driven model for predicting knowledge, attitudes, and practices regarding medication safety among residents in Hubei, China

Affiliations

Machine learning-driven model for predicting knowledge, attitudes, and practices regarding medication safety among residents in Hubei, China

Chao Mei et al. Front Public Health. .

Abstract

Objective: To evaluate the current state and determinants of medication safety knowledge, attitudes, and practices (KAP) among residents in Hubei Province, and to offer guidance for targeted educational initiatives.

Methods: A standardized questionnaire from the Science and Technology Development Center of the Chinese Pharmaceutical Association was utilized. Responses were scored systematically. Univariate and multivariate Logistic regression analyses, along with machine learning (ML) techniques, were applied to identify risk factors associated with medication safety KAP.

Results: Out of 1,065 distributed questionnaires, 1,042 were valid (91.8% response rate). The study revealed that 30.2% of residents demonstrated 'excellent' medication knowledge, while attitude and practice scores were lower 10.3 and 46.3%, respectively. Univariate analysis indicated that age, monthly income, employment status, and occupation significantly influenced KAP. Multivariate analysis further identified age (≥65 years: OR = 0.27), education level (Middle school: OR = 0.36, Primary school: OR = 0.16), occupation (Healthcare workers: OR = 3.67), and medical insurance coverage (Basic social medical insurance: OR = 17.48, Out-of-pocket medical care: OR = 7.44, Publicly-funded medical care: OR = 11.92) as independent risk factors affecting the total KAP score. In evaluating ML models for predicting KAP, the eXtreme Gradient Boosting (XGB) model showed the best performance for predicting knowledge (training accuracy: 0.7014, Kappa: 0.3045; validation accuracy: 0.6186, Kappa: 0.1004). The Fully Connected Neural Network (FCNN) was optimal for attitude prediction (training accuracy: 0.7205, Kappa: 0.0778; validation accuracy: 0.7019, Kappa: 0.0008). The Ordered Multinomial Logistic Regression model was most accurate for practice prediction (training accuracy: 0.6471, Kappa: 0.3421; validation accuracy: 0.6302, Kappa: 0.3153). And the Deep Neural Network (DNN) model demonstrated the highest accuracy for predicting the total score (training accuracy: 0.7387, Kappa: 0.3211; validation accuracy: 0.7074, Kappa: 0.1902).

Conclusion: Residents of Hubei have a fundamental grasp of medication safety but also harbor certain misconceptions. Effective pharmaceutical science communication should take into account the characteristics of the residents and the identified risk factors.

Keywords: KAP; machine learning; medication behavior; model; rational drug use.

PubMed Disclaimer

Conflict of interest statement

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Figures

Figure 1
Figure 1
Feature importance ranked by the mean absolute magnitude of SHAP values within the XGB model for knowledge prediction. The SHAP values are a measure of a feature’s contribution to the prediction, with positive values indicating an increase in the prediction and negative values indicating a decrease. SHAP: SHapley Additive exPlanation; XGB: eXtreme Gradient Boosting; Class 1: poor; Class 2: adequate; Class 3: excellent.
Figure 2
Figure 2
Feature importance (top 10 features) ranked by the mean absolute magnitude of SHAP values within the FCNN model for attitude prediction. The SHAP values are a measure of a feature’s contribution to the prediction, with positive values indicating an increase in the prediction and negative values indicating a decrease. SHAP: SHapley Additive exPlanation; FCNN: Fully Connected Neural Network model; Class 1: poor; Class 2: adequate; Class 3: excellent.
Figure 3
Figure 3
Bee-swarm plots of feature importance within the Ordered Multinomial Logistic Regression model for practice prediction. The x-axis represents the individual variables and the y-axis indicates their importance scores. Variables are color-coded to denote their impact on the model’s output: green for positive influence and red for negative influence. Class 1: poor; Class 2: adequate; Class 3: excellent.
Figure 4
Figure 4
Feature importance (top 10 features) ranked by the mean absolute magnitude of SHAP values within the DNN model for total score prediction. The SHAP values are a measure of a feature’s contribution to the prediction, with positive values indicating an increase in the prediction and negative values indicating a decrease. SHAP: SHapley Additive exPlanation; DNN: Deep Neural Network; Class 1: poor; Class 2: adequate; Class 3: excellent.

References

    1. Qin S, Zhao J, Zhou M, Cheng Y, Ding Y. Self-medication and its typology in Chinese elderly population: a cross-sectional study. Front Public Health. (2022) 10:954305. doi: 10.3389/fpubh.2022.954305, PMID: - DOI - PMC - PubMed
    1. Darden ME, Papageorge NW. Rational self-medication. Econ Hum Biol. (2024) 53:101350. doi: 10.1016/j.ehb.2024.101350, PMID: - DOI - PubMed
    1. Al Shibly MNR, Hasan LA, Abdulsada AR. Knowledge and practice of self-medication. J Popul Ther Clin Pharmacol. (2022) 28:e62–70. doi: 10.47750/jptcp.2022.863, PMID: - DOI - PubMed
    1. Rehman M, Ahmed S, Ahmed U, Tamanna K, Sabir MS, Niaz Z. An overview of self-medication: a major cause of antibiotic resistance and a threat to global public health. J Pak Med Assoc. (2021) 71:943–9. doi: 10.47391/JPMA.1331, PMID: - DOI - PubMed
    1. Yuan J, Du W, Li Z, Deng Q, Ma G. Prevalence and risk factors of self-medication among the pediatric population in China: a National Survey. Front Public Health. (2021) 9:770709. doi: 10.3389/fpubh.2021.770709, PMID: - DOI - PMC - PubMed

LinkOut - more resources