Interactive explainer

Algorithmic Bias Explorer

A clinical risk prediction simulation based on the cost-as-proxy problem described by Obermeyer et al.

500 simulated patients Client-side only D3-powered scatter plot Fairness tradeoffs
Scenario

Hospital care management flagging patients who would benefit from additional support.

Model target

Switch between cost prediction and direct need prediction.

Fairness lens

Compare none, demographic parity, equalized odds, and calibration.

Population map

Each dot is a patient. X is the model's effective score, Y is actual health need. Dark dots are Group A, cardinal dots are Group B. Enrolled patients are shown at full strength; non-enrolled patients are muted.

Story mode 1 / 5

Hover a patient to see exact values and enrollment status. Threshold is applied after the chosen fairness adjustment.
Group A Group B Muted points were not enrolled

Fairness summary

The model is scored against the underlying need threshold, then summarized by group. This is where the tension becomes visible: correcting one problem can create another.

Current bias readout

Loading...

Overall accuracy

Share of patients classified correctly against the true need threshold.

Group A enrollment

Positive prediction rate for Group A.

Group B enrollment

Positive prediction rate for Group B.

True positive gap

Difference in TPR between groups. Big gaps mean one group's high-need patients are being missed more often.

False negative gap

Difference in missed high-need cases between groups.

Positive predictive value gap

When equalized odds improves one metric, calibration or PPV can still move in the wrong direction.

About this tool

This page is a simplified teaching model, not a clinical decision system. It simulates 500 patients with similar underlying health-need distributions across two abstract groups, then uses observed healthcare spending as a proxy when the target is set to cost.

  • Access disparity suppresses Group B spending relative to need, which lowers cost-based scores even when underlying need is the same.
  • Demographic parity equalizes enrollment rates, equalized odds tries to equalize TPR and FPR, and calibration rescales scores so they better reflect need.
  • The formulas are intentionally transparent and approximate. They are meant to illustrate tradeoffs, not estimate real hospital performance.
  • The model runs entirely in the browser and can be used on desktop or mobile without a backend.