Pregnancies classified as high-risk play a significant role in increasing health complications and deaths among mothers and newborns, making early risk identification essential for timely clinical intervention. Although machine learning has shown promising performance in predicting pregnancy risk, most existing studies rely on binary classification and provide limited model interpretability. This study proposes an interpretable multiclass machine learning framework that predicts pregnancy risk using maternal health records from primary healthcare facilities. A total of 2,553 maternal medical records collected from five community health centers in Koto Tangah District, Padang City, Indonesia, were analyzed. The proposed framework integrates data preprocessing, StandardScaler, Synthetic Minority Over-sampling Technique (SMOTE), GridSearchCV-based hyperparameter optimization, and Shapley Additive exPlanations (SHAP). Four machine learning algorithms, which are Logistic Regression, Decision Tree, Support Vector Machine, and Random Forest, were systematically assessed with the application of Accuracy, Precision, Recall, F1-score, and ROC-AUC. Of the machine learning models considered, Random Forest performed best, achieving 97.26% accuracy, 90.44% precision, 98.06% recall, 93.65% F1-score, and 99.79% ROC-AUC. SHAP analysis identified Heart Rate, Blood Glucose, Diastolic Blood Pressure, and Systolic Blood Pressure as the most influential predictors, while also improving model transparency through feature contribution and interaction analysis. The results indicate that the suggested framework delivers precise and interpretable multiclass pregnancy risk prediction, demonstrating how it can assist with the early detection of pregnancy risks within primary care environments.
Copyrights © 2026