Interactive model explainer · simulated data

How a dense network learns nonlinear EHR patterns

Compare the known data-generating process with logistic regression and a small neural network, then trace one simulated patient through the model.

Simulated cohort2,0001,600 train · 400 validation
Observed events42.2%Generated from known individual risks
Validation Brier0.210 → 0.197MLP improves error by 6.2%
Learning questionCan the MLP recover shape?Interactions · threshold · U-shape
Epoch 000,000
Epoch snapshot
1

Choose a pattern in the data

Each scenario isolates a structure that a purely linear model cannot express directly.

2

Compare truth and model predictions

selected patientrisk scale: 0–1
Comparison chart for the selected risk pattern.

The black marker is the selected patient. Curves and matrix cells show conditional risk while the patient’s other features remain fixed.

4

Follow this patient through the network

By default, each unit shows its two strongest incoming contributions for this patient—not every learned weight.

decreases next unitincreases next unitline width = |current activation × weight|
5

Watch learning and validation diverge

Lower Brier score is better. The final MLP is only modestly better than the linear baseline.

Training and validation Brier score chart.

Patient-level sensitivity

Comparable one-standard-deviation or 0→1 changes; these are counterfactual probes, not causal effects.

Logistic · contribution to log-odds

MLP · change in event score

What generated these data?

The outcome is sampled from a known nonlinear risk formula. That lets us distinguish the patient’s latent probability from the single event/no-event label that happened to be observed.

Browse curated examples

This table contains 180 deliberately selected examples from the 2,000-patient simulation; it is a teaching browser, not a representative cohort summary. Click a row to load it above.

Simulated data only. No real EHR extracts, no PHI, no upload. This lab teaches representation — not deployment on hospital data.