liveBook · Manning

Weighted average Gini impurity

Weighted average Gini impurity is the sample-size-weighted average of the Gini impurities of the subsets produced by a decision-tree split.

How 3 Manning books explain it

Statistics Every Programmer Needs

Weighted average Gini impurity is the observation-count-weighted impurity of the child groups produced by a decision-tree split.

How it is used
Selects decision-tree root and internal-node splits by comparing the class impurity produced by candidate features or thresholds.
How deep it goes
Explains separate child calculations and row-count weighting, but does not provide the full displayed equation.
Examples
Uses PLAY_TYPE class counts and the numeric TO_GO <= 3.5 threshold with observed CONVERT counts.
What you can do after
Apply it to calculate and compare candidate decision-tree splits for selecting node conditions.

Read how Statistics Every Programmer Needs explains weighted average Gini impurity →

Grokking Machine Learning

A split-quality measure equal to the size-weighted average of the Gini impurity indices of the resulting subsets.

How it is used
Ranks candidate decision-tree splits by how pure their resulting subsets are.
How deep it goes
Calculates impurity for concrete subsets and compares seven candidate cutoffs, without extending beyond the split-selection example.
Examples
Uses an app-recommendation dataset containing user ages and labels, with seven possible age-based splits.
What you can do after
Evaluate candidate decision-tree questions and select the split with the lowest weighted impurity in the demonstrated dataset.

Read how Grokking Machine Learning explains weighted average Gini impurity →

Grokking Machine Learning, Second Edition

The weighted Gini index is the average Gini impurity of subsets produced by a split, weighted by their sample sizes.

How it is used
Selects decision-tree splits by preferring leaves with the lowest size-weighted impurity.
How deep it goes
Works through a numerical age-split example and compares seven candidate splits, but does not provide implementation code.
Examples
Uses app recommendations, user ages, labels A/B/C, and seven age-based questions as concrete split examples.
What you can do after
Evaluate candidate decision-tree splits and identify the one with the lowest weighted impurity.

Read how Grokking Machine Learning, Second Edition explains weighted average Gini impurity →

What to know first

Related concepts

Questions about weighted average Gini impurity

What is weighted average Gini impurity?

Weighted average Gini impurity is the sample-size-weighted average of the Gini impurities of the subsets produced by a decision-tree split.

Which Manning books explain weighted average Gini impurity?

Statistics Every Programmer Needs, Grokking Machine Learning and Grokking Machine Learning, Second Edition.

What should I know before learning weighted average Gini impurity?

Manning books that teach weighted average Gini impurity usually introduce decision stump first.

What is the difference between weighted average Gini impurity and Gini gain?

Weighted average Gini impurity is the sample-size-weighted average of the Gini impurities of the subsets produced by a decision-tree split. The reduction in Gini impurity obtained by comparing a parent node with the weighted impurity of its child leaves.

What is weighted average Gini impurity part of?

Weighted average Gini impurity is part of Gini impurity. Gini impurity is a measure of class-label heterogeneity in a set or decision-tree node, calculated from the proportions of its classes.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.