Glossary · Phase 3 · Machine learning
Gini impurity
How mixed a group is: the chance two random picks from it (with replacement) disagree. 0 means everyone in the group has the same label.
A good question splits the customers into two groups that are each as pure as possible. Ideally the stayers end up on one side and the churners on the other. To compare questions, the tree needs a number for how mixed a group is. The usual one is Gini impurity.
Try it now
Raise the depth and watch the score on seen points climb to 100% while the score on new points stops improving.
Learn it properly
Decision trees · Learn a flowchart of yes/no questions. About 30 minutes.
Other terms from the same lesson
- decision tree: A model that asks a series of yes/no questions about the inputs to reach a prediction.
- leaf: An end point of a decision tree, with no more questions. It gives the prediction.
- pruning: Cutting back the branches of a decision tree that don't help on validation data, so it overfits less.
Never trained an AI?
Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.