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.

Random seed · 42
1,014Original dataset rows
562Exact duplicate rows removed
452Rows retained for modelling
35Predictor profiles with conflicting labels

End-to-end workflow

From routine measurements to an auditable output.

Every learned preprocessing step is fitted within the relevant training fold.

01

Audit

Validate fields and labels

02

Deduplicate

Remove exact repeated rows

03

Group split

Keep matching profiles together

04

Engineer

Create 20 clinical features

05

Compare

Cross-validate six model families

06

Explain

Audit errors and feature influence

Dataset

Maternal Health Risk Data collected through IoT-based monitoring across hospitals, community clinics, and maternal-care facilities.

FieldMeaningObserved range
AgeMaternal age during pregnancy10–70 years
SystolicBPUpper blood-pressure value70–160 mmHg
DiastolicBPLower blood-pressure value49–100 mmHg
BSBlood glucose concentration6–19 mmol/L
BodyTempBody temperature98–103 °F
HeartRateResting heart rate60–90 bpm
RiskLevelTarget classLow / 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.

Development359
Holdout93
Low risk234
Mid risk106
High risk112

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.

AgeSystolicBPDiastolicBPBSBodyTempHeartRate

Engineered signals

Calculated identically during training and browser inference.

Pulse pressureMean arterial pressureBP ratioShock indexAge × glucoseBP × glucose stressGlucose × heart rateHypertensionHigh BPHypotensionHigh glucoseVery high glucoseFeverHigh feverTachycardiaBradycardiaTeen pregnancyOlder pregnancyExtreme ageRisk signal count

Comparative modelling

Six candidates, one diverse ensemble.

The one-standard-error rule selected an ensemble of five model families using development data only.

ET

Extra Trees

Randomized tree ensemble; strongest high-risk recall among candidates.

RF

Random Forest

Bagged decision trees; highest holdout macro F1.

SV

Support Vector

Scaled radial-basis classifier and best single development mean.

LG

LightGBM

Leaf-wise gradient boosting for non-linear tabular patterns.

XG

XGBoost

Regularized gradient-boosted trees with multiclass probabilities.

CB

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.