Abstract
BACKGROUND: Contraceptive continuation is crucial for assessing the quality and effectiveness of family planning programs, yet it remains challenging, particularly in sub-Saharan Africa. Traditional statistical methods may only partially capture complex relationships and interactions among variables. Machine learning, an artificial intelligence domain, offers the potential to handle large and intricate datasets, uncover hidden patterns, make accurate predictions, and provide interpretable results. OBJECTIVE: Using data from the last four Demographic and Health Surveys, our study utilised a machine learning model to predict contraceptive continuation among women aged 15–49 in a West African country. Additionally, we employed SHAP (SHapley Additive exPlanations) analysis to identify and rank the most influential features for the prediction. METHODS: We employed LightGBM, a gradient-boosting framework that employs tree-based learning algorithms, to construct our predictive Model. Our multilevel LGBM model accounted for country-level variations while controlling for individual variables. Furthermore, optimization techniques were utilized to enhance performance and computation efficiency. Hyperparameter tuning was conducted using Optuna, and the machine learning model performance was evaluated based on accuracy and area under the curve (AUC) metrics. SHAP analysis was employed to elucidate the Model’s predictions and feature impacts. RESULTS: Our final Model demonstrated an accuracy of 74% and an AUC of 82%, highlighting its effectiveness in predicting contraceptive continuation among women aged 15–49. The most influential features for prediction encompassed the number of children under 5 in the household, age, desire for more children, current family planning method type, total children ever born, household relationship structure, recent health facility visits, country, and husband’s desire for children. CONCLUSION: Machine learning is a valuable tool for accurately predicting and interpreting contraceptive continuation among women in sub-Saharan Africa. The identified influential features offer insights for designing interventions tailored to different groups, catering to their specific needs and preferences, and ultimately improving reproductive health outcomes. SUPPLEMENTARY INFORMATION: The online version contains supplementary material available at 10.1186/s12978-025-02170-3.