⚡ Random Forest 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 random forest, the model the team finally chooses, and compares it with the other algorithms of the chapter.

The interactive notebook includes:

  • Bootstrap samples and a forest built by hand, voting with the mode.
  • The out-of-bag (OOB) accuracy, and the effect of the number of trees and of the features per node.
  • Stability: forests trained on almost the same data agree, single trees do not.
  • Multiclass evaluation: per-class precision, recall and F1, starting with the book's 3-level example.
  • Impurity-based and permutation feature importance.
  • The critical levels: class weights, and a cautious decision threshold for Level 1 chosen with OOB probabilities.
  • Comparison with KNN, the decision tree, One-vs-Rest logistic regression and One-vs-One SVM.

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

Bibliography