1. Introduction
Hypertensive disorders of pregnancy (HDP) complicate approximately 5%–10% of pregnancies worldwide and remain a leading cause of maternal morbidity and mortality [
1,
2]. The pathophysiological alterations underlying HDP frequently persist beyond delivery, elevating the risk of acute maternal complications and long-term cardiovascular diseases [
3,
4]. Recent evidence suggests that the onset of hypertension in women with a history of HDP may occur much earlier than previously recognized. In a recent meta-analysis, Giorgione et al. [
5] reported that postpartum hypertension was diagnosed within the first 2 years following pregnancy in 468 of 1646 women (28.4%). Moreover, the pooled analysis demonstrated a substantially increased risk of developing postpartum hypertension after HDP compared with normotensive pregnancies (odds ratio [OR]: 5.75, 95% confidence interval [CI]: 3.92–8.44; I
2 = 49%) [
5].
Current clinical guidelines recommend routine blood pressure reassessment at 6 weeks postpartum [
6]. However, this strategy is severely limited by high rates of loss to follow-up, delaying the identification of women at high risk. This critical clinical gap underscores the need for robust pre-discharge risk-stratification tools [
7].
Machine learning (ML) algorithms have increasingly demonstrated superior predictive performance over conventional statistical models by capturing complex, high-order nonlinear interactions in clinical data [
8]. Despite these advances, existing predictive models for postpartum hypertension remain methodologically limited. The widespread incorporation of post-discharge variables in existing prediction models introduces target leakage, thereby artificially inflating estimates of predictive performance [
9]. Furthermore, an overreliance on discriminatory metrics, coupled with the inherent “black-box” nature of advanced algorithms, compromises model calibration and clinical interpretability, posing a significant barrier to real-world translation.
Therefore, this study aimed to develop and internally validate ML models based exclusively on pre-discharge data for the early prediction and risk stratification of persistent postpartum hypertension (PPPH). In accordance with the Transparent Reporting of a Multivariable Prediction Model for Individual Prognosis or Diagnosis-Artificial Intelligence (TRIPOD-AI) guidelines, the clinical utility of the models was rigorously evaluated using decision curve analysis (DCA). Furthermore, model interpretability was achieved via Shapley Additive Explanations (SHAP) to enhance clinical applicability [
10,
11]. To the best of our knowledge, this is the first study to develop a ML-based pre-discharge triage tool for PPPH using exclusively pre-discharge clinical data in a Vietnamese cohort, addressing a critical gap in the postpartum surveillance literature for low- and middle-income settings.
2. Materials and Methods
2.1 Study Design and Setting
This study was conducted as a secondary analysis of a previously published prospective cohort [
12]. The primary cohort enrolled 336 women with HDP who delivered at the National Hospital of Obstetrics and Gynecology, Hanoi, Vietnam, between March and November 2023. Detailed descriptions of the study design, data collection procedures, and primary results have been reported elsewhere [
12]. All study procedures were conducted in accordance with the Declaration of Helsinki. This study was reported in accordance with the TRIPOD-AI and the Strengthening the Reporting of Observational Studies in Epidemiology (STROBE) guidelines.
2.2 Study Population
Of the 336 women enrolled in the primary prospective cohort, the present analysis was restricted to 301 women with new-onset HDP (gestational hypertension, n = 67; preeclampsia-eclampsia, n = 234). Women with preexisting chronic hypertension (n = 16) or superimposed preeclampsia on chronic hypertension (n = 19) were excluded, as their postpartum blood pressure trajectories reflect persistent prepregnancy pathophysiology rather than pregnancy-induced cardiovascular dysregulation (Fig.
1, Ref. [
12]). Eligibility criteria for the primary cohort included women aged ≥18 years with a confirmed pregnancy at ≥20 weeks of gestation who were diagnosed with HDP according to American College of Obstetricians and Gynecologists criteria [
6].
2.3 Study Outcome
The primary outcome was PPPH, defined as a systolic blood pressure (SBP) ≥140 mmHg and/or diastolic blood pressure (DBP) ≥90 mmHg, or the ongoing use of antihypertensive therapy, at 6 weeks postpartum. This time point aligns with current postpartum follow-up guidelines [
6] and captures a critical clinical window for therapeutic intervention. In the primary cohort, the prevalence of PPPH was 12.96% at 6 weeks postpartum and 7.6% at 3 months postpartum [
12].
Prior to hospital discharge, all participants received a validated home blood pressure monitor (Omron M2 Basic HEM7120-E; Omron Healthcare, Kyoto, Japan). Standardized training on home blood pressure measurement techniques was provided to each participant and a designated family member by trained research staff in accordance with the Ministry of Health of Vietnam and American Heart Association (AHA) guidelines [
12]. Blood pressure assessment at 6 weeks postpartum was conducted by trained research staff via standardized telephone interview, during which participants were instructed to report two consecutive morning blood pressure measurements obtained after 5 minutes of seated rest. Women who reported an SBP ≥140 mmHg or DBP ≥90 mmHg, or who reported ongoing use of antihypertensive medication, were classified as having PPPH.
2.4 Feature Selection and Timeframe
The feature extraction window was strictly restricted to the period from hospital admission through 72 hours postpartum to prevent target leakage and ensure the model’s applicability as a pre-discharge risk stratification tool. Candidate predictors included maternal demographic and obstetric characteristics, admission clinical parameters, biochemical markers of end-organ involvement, and early postpartum blood pressure trajectories on postpartum days 1 and 3.
2.5 Data Preprocessing and ML Model Development
Data preprocessing and all ML pipelines were executed using the tidymodels framework in R (version 4.5.0, R Foundation for Statistical Computing, Vienna, Austria). The normality of continuous variables was assessed using the Shapiro-Wilk test, complemented by visual inspection of normal Q-Q plots and histograms. Given evidence of departure from normality (Shapiro-Wilk test, p < 0.05), continuous variables were summarized as medians with interquartile ranges (Q1–Q3) and compared between groups using the Mann-Whitney U (Wilcoxon rank-sum) test. Categorical variables were summarized as frequencies and percentages [n (%)]. Pearson’s chi-square test was used when its assumptions were satisfied, whereas Yates’ continuity-corrected chi-square test was applied to 2 × 2 tables when the minimum expected cell frequency was between 1 and <5. A two-sided p < 0.05 was considered statistically significant. Among the 25 candidate predictors, 24 had complete data, while missing values occurred exclusively for lactate dehydrogenase (LDH; 7.3%, 22/301 cases). As no predictor exceeded the predefined 20% missingness threshold, all 25 predictors were retained for model development. Continuous variables were standardized by Z-score normalization, and categorical variables were converted to dummy variables. Predictors exhibiting zero variance were removed before model development. All data-dependent preprocessing procedures were incorporated into the tidymodels recipe and estimated exclusively within the training portion of each bootstrap resampling iteration, with the resulting preprocessing parameters subsequently applied to the corresponding assessment data to prevent information leakage.
Due to the relatively small sample size (n = 301) and class imbalance (outcome prevalence, 12.96%), a 500-repeat standard bootstrap resampling framework with replacement was employed for internal validation. Optimism was estimated as the mean difference between the apparent and bootstrap-validated performance metrics across all 500 resamples. Class imbalance was addressed using the Synthetic Minority Over-sampling Technique (SMOTE) [
13]. Three supervised ML algorithms were developed: Ridge logistic regression (LR) (incorporating L2 regularization and splines), Random Forest, and Extreme Gradient Boosting (XGBoost) [
11]. Importantly, both KNN imputation and SMOTE were implemented exclusively within each bootstrap resampling iteration to prevent data leakage. To assess the incremental benefit of oversampling, each algorithm was additionally trained without SMOTE using identical preprocessing and validation procedures. These results are reported in
Supplementary 3 for reference. Hyperparameters were optimized via grid search within each bootstrap resampling loops, with the area under the precision-recall curve (AUPRC) used as the optimization metric. The candidate search ranges and final optimal hyperparameter values for all machine learning models following grid search optimization within the 500-repeat bootstrap resampling framework are detailed in
Supplementary 4. Although the nominal events-per-variable (EPV) ratio was 1.56 (39 events for 25 candidate predictors), we deliberately avoided univariable screening prior to modeling to preserve complex pathophysiological interactions and prevent selection bias. Instead, the risk of overfitting was strictly mitigated through algorithm-specific embedded regularization and hyperparameter constraints. Specifically, Ridge LR utilized an L2 penalty, Random Forest applied strict node size and feature split limitations, and XGBoost was restricted to shallow decision stumps with a conservative learning rate.
2.6 Model Evaluation, Threshold Optimization, and Interpretability
Discriminatory performance was assessed using the area under the receiver operating characteristic curve (AUROC) and the AUPRC, with both metrics reported as 95% CIs derived from the bootstrap distribution. Model calibration was evaluated using the Brier score, calibration intercept (the log-odds intercept from a logistic recalibration model fitted to the bootstrap-validated predictions), calibration slope (the corresponding regression coefficient), and the observed-to-expected (O/E) event ratio. Calibration was further assessed visually using calibration plots with Locally Weighted Scatterplot Smoothing (LOESS) smoothing and 95% CIs. Because SMOTE overrepresents the minority class during training, it can inflate predicted probabilities. Therefore, out-of-bag predictions were recalibrated using Platt scaling prior to calibration and clinical utility assessments. The Youden index, which assumes equal clinical costs for false-negative and false-positive classifications, was considered inappropriate for this high-sensitivity risk stratification application, in which missed PPPH cases carry substantially higher clinical consequences than false-positive predictions. Accordingly, the decision threshold for the champion model was set to achieve a prespecified sensitivity of ≥80%. Sensitivity, specificity, positive predictive value (PPV), negative predictive value (NPV), and F1 score were calculated at the selected threshold. A confusion matrix was constructed to illustrate the clinical trade-offs associated with the selected operating point. DCA was performed to quantify the net clinical benefit across a range of threshold probabilities, comparing each model against treat-all and treat-none strategies [
14]. Model interpretability was achieved using SHAP [
10].
3. Results
3.1 Baseline Characteristics and Clinical Trajectories
Of the 336 women enrolled in the primary cohort, 301 met the eligibility criteria for the present analysis (Fig.
1). PPPH at 6 weeks postpartum was observed in 39 patients (12.96%). Baseline demographic characteristics, obstetric history, and clinical parameters stratified by PPPH status are detailed in Table
1.
Maternal age, prepregnancy body mass index (BMI), and the distribution of HDP subtypes did not differ significantly between the 2 groups. Conversely, women who subsequently developed PPPH exhibited a more severe clinical profile upon admission. This clinical severity was characterized by a significantly earlier gestational age at admission (p = 0.001), a substantially higher prevalence of severe symptoms (p = 0.006), and an elevated admission DBP (p = 0.007).
Furthermore, biochemical assessments indicated more pronounced end-organ involvement in the PPPH group, as evidenced by significantly elevated levels of 24-hour proteinuria (p = 0.039), blood urea nitrogen (BUN) (p = 0.010), and alanine aminotransferase (ALT) (p = 0.001). Disparities in hemodynamic trajectories remained evident during the early postpartum period. Postpartum day 1 SBP was significantly higher in the PPPH group (p = 0.028). Specifically, both SBP and DBP on postpartum day 3 were significantly higher in women progressing to persistent hypertension (p = 0.002 and p = 0.010, respectively). Hypertension on postpartum day 3 was also more prevalent in the PPPH group (p = 0.003).
3.2 Model Performance and Calibration
All models underwent a 500-repeat bootstrap internal validation to mitigate optimism bias. Crucially, synthetic minority oversampling was strictly confined within each bootstrap resampling loop to prevent data leakage.
Optimism-corrected performance metrics are detailed in Table
2. Ridge LR exhibited the highest discrimination (AUROC: 0.648; 95% CI: 0.642–0.654), followed by the Random Forest model (AUROC: 0.638; 95% CI: 0.632–0.643) and XGBoost (AUROC: 0.631; 95% CI: 0.625–0.636). Random Forest was ultimately selected as the final model due to its superior overall calibration profile, with the lowest Brier score (0.130), a calibration intercept closest to zero (−0.794), a calibration slope closest to unity (0.759), and an O/E ratio of 0.544. These findings reflect the most accurate agreement between predicted probabilities and observed risks, as supported by the calibration plots (Fig.
2).
To maximize clinical utility as a potential pre-discharge risk-stratification tool, the decision threshold for the Random Forest model was set at 0.157, prioritizing sensitivity over specificity. At this threshold, the model achieved a sensitivity of 80.2%, a specificity of 35.9%, a PPV of 15.5%, and an NPV of 92.5% (Table
2). For comparison, a strategy that classified all patients as low risk would yield a baseline NPV of approximately 87.0%, given the event prevalence of 12.96%. As such, the model provides an absolute NPV improvement of 5.5 percentage points through individualized risk stratification.
The confusion matrix applied to the primary cohort (n = 301) is presented in Table
3. Of the 39 PPPH cases, 31 were correctly classified as high-risk (true positives), whereas 8 were missed (false negatives). The trade-off inherent to this high-sensitivity operating point was an elevated false-positive rate, with 168 of 262 women who did not develop PPPH classified as high-risk, reflecting the low baseline prevalence of the outcome.
The confusion matrix applied to the primary cohort (n = 301) is presented in Table
3, illustrating the clinical trade-offs of the selected threshold on the original unresampled dataset. Of the 39 PPPH cases, 31 were correctly classified as high-risk (true positives), whereas 8 were missed (false negatives). The trade-off inherent to this high-sensitivity operating point was an elevated false-positive rate, with 168 of 262 women who did not develop PPPH classified as high-risk, reflecting the low baseline prevalence of the outcome.
A sensitivity analysis comparing SMOTE versus no-SMOTE pipelines is presented in Supplementary 3. Models trained without SMOTE exhibited improved probabilistic calibration relative to the primary SMOTE models, with calibration intercepts approaching zero (Ridge LR: 0.002; Random Forest: −0.118) and O/E ratios near 1.0 (1.002 and 0.909, respectively). However, the omission of class imbalance correction substantially reduced sensitivity for detecting the minority class. When evaluated at the Youden index threshold, the unadjusted Ridge LR, Random Forest, and XGBoost models achieved sensitivities of 46.6%, 53.2%, and 62.2%, respectively, all failing to meet the prespecified threshold of ≥80% for the primary risk stratification models. These findings confirm that SMOTE was necessary to achieve adequate sensitivity in this imbalanced cohort, albeit at the expected cost of probability inflation requiring subsequent Platt scaling recalibration.
3.3 Net Clinical Benefit and Clinical Utility
DCA was used to quantify the net clinical benefit of the models (Fig.
2B). Across the clinically relevant threshold probability range of approximately 15% to 25%, the Ridge LR model consistently achieved the highest net benefit, outperforming both XGBoost and Random Forest models. The clinical utility of the Random Forest model declined more rapidly, intersecting the treat-none strategy at a threshold of approximately 23%. Beyond a 28% threshold, corresponding to the region of greater statistical uncertainty reflected in the calibration curves, all models provided minimal or no additional net benefit compared with the default clinical strategies.
3.4 Model Interpretation and Clinical Relevance
SHAP analysis was performed to elucidate the model’s decision-making process and ensure clinical transparency. The final Random Forest model incorporated the following pre-discharge variables: ALT, gestational age at admission, admission SBP, admission DBP, postpartum day 3 SBP, postpartum day 3 DBP, postpartum day 1 SBP, postpartum day 1 DBP, hypertension on postpartum day 3, BUN, proteinuria (g/24 h), severe clinical symptoms, history of preeclampsia, history of gestational hypertension, gestational weight gain, pre-pregnancy BMI, maternal age, platelet count, creatinine, LDH, AST, mode of delivery, multiple pregnancy, gestational diabetes mellitus, and HDP subtype classification.
As shown in Fig.
3A, the global feature importance ranking identified ALT, BUN, maternal age, LDH, and postpartum day 3 SBP as the five most influential predictors. The SHAP beeswarm plot (Fig.
3B) further delineated the direction and magnitude of these features on individual risk estimates. Higher values of markers of hepatic and renal injury (ALT, BUN), elevated LDH, advanced maternal age, and elevated postpartum blood pressure parameters consistently yielded positive SHAP values, directly escalating the predicted risk of PPPH. Conversely, earlier gestational age at admission was strongly associated with a greater predicted risk of PPPH.
4. Discussion
In this study, we developed and internally validated a pre-discharge triage tool to predict PPPH in women with new-onset HDP. By restricting all predictors to the 72-hour pre-discharge window, we eliminated target leakage, which frequently compromises models that incorporate post-discharge variables [
9]. Although overall discrimination was modest (AUROC range 0.631–0.648), we strategically prioritized superior model calibration, as evidenced by the lowest Brier score (0.130), the calibration intercept closest to 0 (−0.794), and the calibration slope closest to 1.0 (0.759) achieved by the Random Forest model [
15]. Accurate calibration ensures that predicted probabilities reflect real-world risks, an essential prerequisite for personalized clinical decision-making.
The predictive features identified by SHAP are strongly consistent with the established pathophysiology of HDP. The ML framework autonomously prioritized elevated hepatic enzyme levels (ALT), markers of renal end-organ involvement (BUN), advanced maternal age, and elevated postpartum blood pressure trajectories (day 3 SBP). Biologically, elevated ALT reflects hepatic endothelial dysfunction [
16], elevated BUN indicates renal involvement and reduced glomerular filtration characteristic of severe HDP, elevated LDH reflects systemic hemolysis and endothelial injury, and persistently elevated postpartum blood pressure on day 3 directly predicts failure of cardiovascular normalization following delivery [
17,
18]. Advanced maternal age further increases cardiovascular risk through age-related reductions in vascular compliance and endothelial reserve. The algorithm’s capacity to independently capture these complex, nonlinear biological patterns supports its clinical plausibility.
The practical utility of these models was confirmed by DCA. Within the clinically relevant threshold probability range of 15%–25%, the Ridge LR model achieved the highest net clinical benefit, outperforming both XGBoost and Random Forest, as well as the default treat-all and treat-none strategies [
14]. At the selected threshold of 0.157, the Random Forest model achieved an NPV of 92.5%, representing a 5.5 percentage point improvement over the no-model baseline of 87.0%. This performance enables individualized risk stratification rather than a uniform monitoring approach for all patients. Consequently, this mechanism supports the strategic reallocation of limited clinical resources toward intensive monitoring and early pharmacological intervention for high-risk individuals.
The AUPRC values (0.211–0.248) represent a meaningful improvement over the no-skill baseline of approximately 0.13, consistent with the inherent challenge of predicting a heterogeneous outcome in a small, imbalanced cohort with 39 outcome events. Future studies incorporating larger sample sizes and additional candidate predictors, such as angiogenic biomarkers, which have recently demonstrated significant peripartum kinetic alterations in gestational hypertension [
19], or abbreviated urine protein quantification [
20], may further improve discriminatory performance.
Limitations
This study has several limitations. First, the single-center design and modest sample size (n = 301, including 39 outcome events) limit the generalizability of findings to broader and more diverse clinical settings. While this small number of events yielded a low nominal EPV ratio, modern ML frameworks rely on algorithmic regularization rather than strict EPV thresholds to prevent overfitting. Furthermore, our SHAP analysis confirmed that the model's predictive engine is highly parsimonious; clinical predictions are predominantly driven by a core subset of 5 to 10 features. This results in a robust effective clinical EPV (e.g., 39 events for the top 5 features = 7.8) that exceeds traditional safety thresholds and supports practical bedside feasibility. Second, ascertainment of the 6-week outcome through telephone interviews rather than in-person measurements may have introduced self-reporting or misclassification bias. To optimize data quality, all participants received a validated home blood pressure monitor at no cost, supplemented by structured follow-up conducted by trained research staff. Although these measures likely improved participant retention and data completeness, future protocols would benefit from incorporating scheduled, in-person clinical assessments. Third, the bootstrap validation framework provides only internal validation; therefore, overfitting cannot be fully excluded despite optimism correction. Fourth, the predictive model was developed using a limited set of pre-discharge variables, whereas PPPH is a complex endocrine and hemodynamic process that is likely influenced by additional factors not captured in this dataset. External validation across larger, multicenter cohorts is required before this risk stratification tool can be considered for integration into routine clinical practice. Fifth, our predictive modeling was restricted to the 6-week postpartum period. Although 3-month follow-up data were available (event rate, 7.6%), modeling this later endpoint was not statistically feasible due to the extreme class imbalance and the failure to meet acceptable EPV thresholds, which would inevitably induce severe model overfitting.
5. Conclusions
This study developed and internally validated an ML-based pre-discharge risk stratification framework for PPPH in women with new-onset HDP. Although the current model demonstrated modest discrimination (AUROC: 0.638) and required external validation in larger, multicenter cohorts before clinical implementation, the Random Forest model exhibited a well-calibrated risk profile, with SHAP analysis identifying ALT, BUN, and maternal age as the primary predictors. The NPV of 92.5% at the selected high-sensitivity threshold, representing an absolute improvement over the no-model baseline, supports the potential utility of this proof-of-concept framework for individualized pre-discharge risk stratification and the targeted allocation of postpartum monitoring resources toward high-risk individuals.