AI engineering glossary · Classical ML algorithms

What is tree pruning?

Tree pruning: Reducing the size of a decision tree by cutting branches that add little predictive value, either by stopping growth early or by trimming a full tree afterwards. It lowers the chance of memorising noise and yields simpler, more robust models.

Level: intermediateTopic: Classical ML algorithms

Tree pruning: an example

In scikit-learn, setting max_depth=5 or ccp_alpha=0.01 restricts the tree so it cannot grow a leaf for every training row.

Related terms

More Classical ML algorithms terms

Where you learn it

Tree pruning is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.