⚡ Decision Tree for Emergency Triage

In chapter 4 the Minermont team wants a system that suggests the urgency level of each emergency patient, from 1 (red) to 5 (blue), always as a support for the triage nurse. This notebook studies the decision tree, the model that most excites Claire because it resembles how nurses think in triage, and also its two weaknesses.

The interactive notebook includes:

  • The Gini impurity and the search for the best split, by hand, compared with scikit-learn.
  • A tree without limits: 100% on the training data and much worse on new patients.
  • Choosing the maximum depth with cross-validation.
  • A small tree drawn and written as rules that clinicians can read and check.
  • Rigid thresholds (one year of age changes the level) and instability (two trees trained on almost the same data disagree).
  • Final evaluation with the confusion matrix and per-class metrics.

Want to modify the code and experiment on your own?
Open the notebook in Google Colab

Bibliography