⚡ One-vs-Rest, One-vs-One and Softmax from Scratch

Before the algorithms that are multiclass by nature, Hazel shows the team how to build a five-class classifier out of binary ones, and the team raises their weak points: the imbalance of 'Level 1 vs the rest', the ambiguity when no classifier is confident and the ties in the vote. This notebook builds One-vs-Rest, One-vs-One and softmax regression from scratch on the triage patients and compares them.

The interactive notebook includes:

  • Binary logistic regression as the building block.
  • One-vs-Rest: five classifiers, and why the middle level gets squeezed.
  • The ambiguity of One-vs-Rest: scores that do not add up to 1.
  • One-vs-One: ten classifiers, a vote and the book's rule for ties.
  • Softmax regression with the categorical cross-entropy, checked against scikit-learn.
  • The three strategies side by side: parameters, accuracy, recall per level and confusion matrices.
  • One borderline patient and the answer of each strategy.

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

Bibliography