Clinical Stroke Risk, Threshold Calibration & SHAP Feature Attribution Simulator
Run the triage model on one patient and read the SHAP explanation a physician would see ā then move the decision threshold for the whole hospital and trade missed strokes against clinic capacity.
Predict first
Commit to a guess before you touch anything. Being wrong here is how it sticks.
Lowering the threshold raises recall from 65% to 88% in a cohort with 200 true strokes. How many more patients get preventive care?
Experiment
Move the controls and watch the outputs. Goals tick off automatically when you reach them.
One patient, explained
Decision threshold for the hospital
1,000 patients a month, 5% prevalence. Patients above the threshold are booked into the chronic-care clinic.
Lowering the threshold catches more strokes but books more healthy patients into the clinic. The right threshold is a clinical-capacity decision, not 0.5 by default.
Explain it
Put what you saw into words. This is what the exam will ask you to do.
Why is the default 0.5 threshold wrong here, and how do SHAP values make a prediction actionable for a physician?
Code it
Write real code against real data. Python and SQL run right here in your browser and hidden tests check your work; the AI reviews it like an examiner.
Choose the threshold the clinic can handle
scores are validation-set predicted probabilities and y the true outcomes (1 = stroke).
The chronic-care clinic can take at most capacity referrals per 1,000 patients.
Write choose_threshold(y, scores, capacity) returning the lowest threshold from
np.round(np.arange(0.05, 0.96, 0.01), 2) whose referral rate (share of scores ā„ threshold) Ć 1,000
is ⤠capacity ā that maximises recall within capacity. Also write recall_at(y, scores, t).
Challenge
Fixed variations, a new problem every day, and unlimited AI challenges built from your current settings.
Decision Threshold Calibration for Clinical Recall
At the default 0.50 probability threshold, the classifier flags 30 out of 50 stroke cases (60% recall). Calibrating the decision threshold down to 0.22 enables the model to detect 46 out of 50 stroke cases. What is the new clinical Recall in percent?