All tutorials & labs

Spot overfitting

Identify overfitting by comparing training and validation error as a model becomes more complex.

When does a deeper tree stop helping?

Seven decision trees were fitted to the same training sample and evaluated on a separate validation sample. The error percentages here are illustrative.

Your challenge

Increase tree depth one step at a time. Which depth makes the fewest validation errors?

17
Reveal the answer and interpretation

Depth 3 has 8% validation error. At depth 7 training error reaches zero, but validation error rises to 24%. The deeper tree fits the training sample more closely while making more mistakes on other people.

Validation error

12.0%
0%15%30%17
Tree depth
Results for your scenario
SampleIncorrect predictions
Training12.0%
Validation12.0%

Error rate = incorrect predictions ÷ all predictions in that sample.

Which assumption would you question in this exercise? Bring your question to the Learning Club