Reproducible pipeline
Built to expose leakage, not hide it.
The workflow cleans duplicate observations before splitting, isolates matching predictor profiles, fits preprocessing inside cross-validation, and evaluates each risk class separately.
End-to-end workflow
From routine measurements to an auditable output.
Every learned preprocessing step is fitted within the relevant training fold.
Audit
Validate fields and labels
Deduplicate
Remove exact repeated rows
Group split
Keep matching profiles together
Engineer
Create 20 clinical features
Compare
Cross-validate six model families
Explain
Audit errors and feature influence
Dataset
Maternal Health Risk Data collected through IoT-based monitoring across hospitals, community clinics, and maternal-care facilities.
| Field | Meaning | Observed range |
|---|---|---|
| Age | Maternal age during pregnancy | 10–70 years |
| SystolicBP | Upper blood-pressure value | 70–160 mmHg |
| DiastolicBP | Lower blood-pressure value | 49–100 mmHg |
| BS | Blood glucose concentration | 6–19 mmol/L |
| BodyTemp | Body temperature | 98–103 °F |
| HeartRate | Resting heart rate | 60–90 bpm |
| RiskLevel | Target class | Low / mid / high |
Source: Maternal Health Risk Data on Kaggle.
Profile-isolated split
Repeated predictor combinations were assigned to the same partition to reduce optimistic leakage.
Data-quality repair
One physiologically invalid heart-rate value was set to missing and imputed inside the pipeline.
Feature representation
Six recorded inputs become 26 modelling features.
Deterministic interactions and threshold indicators encode clinically interpretable relationships without learning from the target.
Raw measurements
Values supplied directly by the dataset or the risk studio.
Engineered signals
Calculated identically during training and browser inference.
Comparative modelling
Six candidates, one diverse ensemble.
The one-standard-error rule selected an ensemble of five model families using development data only.
Extra Trees
Randomized tree ensemble; strongest high-risk recall among candidates.
Random Forest
Bagged decision trees; highest holdout macro F1.
Support Vector
Scaled radial-basis classifier and best single development mean.
LightGBM
Leaf-wise gradient boosting for non-linear tabular patterns.
XGBoost
Regularized gradient-boosted trees with multiclass probabilities.
CatBoost
Ordered boosting model included for algorithmic diversity.
Leakage controls
- Exact duplicate rows removed before any split.
- Identical predictor profiles kept in one split and fold.
- Median imputation and scaling fitted within cross-validation.
- No oversampling performed before cross-validation.
- Champion selected on development folds before holdout scoring.
- Legacy row-split benchmark labelled separately and explicitly.
Explainability and diagnostics
- Class-wise confusion matrices expose the direction of errors.
- One-vs-rest counts show sensitivity for each risk class.
- Permutation importance tests dependence on each raw input.
- Model-agnostic SHAP summarizes probability attribution.
- Calibration curves inspect probability reliability.
- Bootstrap intervals show uncertainty around key metrics.
Browser deployment
The fitted ensemble is exported to an open model format and evaluated in the browser. This keeps hosting static and free, while the six measurements remain on the user’s device.