Interactive demo · Probabilistic Machine Learning · Chapter 1

Iris decision trees: empirical risk and loss matrices

A decision tree splits the plane into rectangles by a sequence of threshold tests (1.1) and predicts in each rectangle. Growing it deeper drives the empirical risk (1.4) down on the training flowers; the test flowers show how far that carries over. The risk depends on the loss: with the zero-one loss (1.5) every mistake costs 1, with Table 1.2 a Virginica taken for something else costs 10. Each leaf then predicts the action with the smallest expected loss under its class proportions, which is not always its majority class. Click the plot to ask what the tree thinks of a new flower.

Features

Maximum depth

Fit on

Loss

Try these

Trees are grown greedily by weighted Gini impurity; the thresholds are midpoints between consecutive sorted values and a split is made only if it lowers the impurity. Training set: all 150 flowers, or 100 of them (a fixed stratified split) with the other 50 as test set. Losses: row = truth, column = prediction, in the order Setosa, Versicolor, Virginica; Table 1.2 is [[0,1,1],[1,0,1],[10,10,0]]. Click or tap the plot to set the query point.


    

In the lecture notes