The Application of Random Forest to Identify Determinants of Pregnancy Termination: A Comparison of Two Splitting Criteria
Background: The application of machine learning to medical and healthcare studies has increasingly gained attention in recent years. This paper employed a random forest (RF) model with two splitting criteria, namely the ‘Gini’ and ‘Hellinger distance’ and compared their performance via the out-of-bag (OOB) error. The model with the better performance was used to identify important factors that influence pregnancy termination amongst Tanzanian women. Methods: Data from the 2022 Tanzania Demographic Health Survey (TDHS) with a total weighted sample of 15,245 women aged 15–49 years was analyzed. A random forest model, which considers data with imbalanced classes for the outcome variable, was fitted. ALE plots were implemented to evaluate the factor effects. The Hellinger criterion was chosen for its effectiveness in addressing class imbalance, while ALE plots were employed to offer interpretable insights into the marginal effects of predictors, given the ‘black box’ nature of the RF model. Results: The prevalence of pregnancy termination amongst Tanzanian women was found to be 14.1% (95% CI: 13.5–14.7). The ALE plot suggested that women wanting children within 2 years, after 2 years, or are unsure about the timing have an increased risk of pregnancy termination compared to other categories, which are associated with reduced risk. Being married, living with a partner, divorced or widowed increased the risk of pregnancy termination, while being in a union or no longer living with a partner reduced pregnancy termination risk. Women with a secondary level of education are at a higher risk of terminating a pregnancy compared to other levels of education. Women from rich households have an increased risk of pregnancy termination compared to women from poor or middle-income households. Conclusions: The findings of this study highlight the need for initiating interventions aimed at reducing the rate of pregnancy termination amongst Tanzanian women. Women need to be educated about the use of contraceptive methods and encouraged to explore alternative methods to mitigate the negative outcomes of pregnancy termination.
Authors
- Henry Godwell Mwambi (ORCID: https://orcid.org/0000-0001-9654-400X)
- Sizwe Vincent Mbona (ORCID: https://orcid.org/0000-0002-8077-3833)
- Anisha Ananth (ORCID: https://orcid.org/0000-0002-8295-0733)
- Retius Chifurira (ORCID: https://orcid.org/0000-0001-7889-3417)
- Bonginkosi Duncan Ndlovu
- Shaun Ramroop (ORCID: https://orcid.org/0000-0001-9305-6967)
Institutions
- Durban University of Technology (ZA)
- University of KwaZulu-Natal (ZA)
Publication Details
- Journal
- International Journal of Environmental Research and Public Health
- Published
- 2026-11-30
- DOI
- https://doi.org/10.3390/ijerph23121476
- Primary Topic
- Reproductive Health and Contraception
- Type
- article
- Field-Weighted Citation Impact
- 0.00