Decision TreesAnother Look At Our Decision Tree
Here is Meena's tree again, this time with the entropy of every node written under it. As you go down, the boxes get smaller and the entropy falls. But should a tree really keep going until every leaf is pure? To find out, Meena buys 10 new mangoes whose kinds she knows and checks how many each tree gets right. They are the hollow rings on the chart. The line chart at the bottom keeps score: training mangoes and new mangoes. Complete both missions.
Maximum depth:
The training score only climbs, but the new-mango score rises and then falls. The depth-3 tree is perfect on its 20 training mangoes, yet it gets two new mangoes wrong. Its third question, "weight ≤ 337.5", only exists to carve out one unusually long, heavy Alphonso — and new Totapuris of about 330 g fall into that thin strip. The tree learned noise, not a pattern.
How Deep Is Deep Enough?
Why might we stop a decision tree from growing before every leaf is pure?
The danger of going too deep
A tree that splits until every leaf is pure learns its training data by heart, freak mangoes included. We stop it earlier so that it