AI engineering glossary · Classical ML algorithms

What is gini impurity?

Gini impurity (also called Gini index): A measure of how mixed the classes are in a group of examples: 1 minus the sum of squared class proportions. It is 0 when all items share one class and highest when classes are evenly mixed. Tree building picks splits that reduce it the most.

Level: intermediateTopic: Classical ML algorithms

Gini impurity: an example

A node with 6 spam and 4 not-spam emails has Gini = 1 - (0.6^2 + 0.4^2) = 0.48.

Related terms

More Classical ML algorithms terms

Where you learn it

Gini impurity 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.