Classification - Impurity Measures
7 important questions on Classification - Impurity Measures
What is an impurity measure? What do maximum and minimum impurity mean?
- Maximum impurity — all classes are equally represented (e.g., 50/50 for binary) → most uncertain
- Minimum impurity (0) — all records belong to the same class → perfectly pure node
Write the formulas for Entropy, Gini Index, and Classification Error.
- Entropy: −Σᵢ p(i|t) · log₂ p(i|t)
- Gini Index: 1 − Σᵢ [p(i|t)]²
- Classification Error: 1 − maxᵢ p(i|t)
For a binary node with p fraction positive, compute all three impurity measures at p = 0.5 and p = 0.
- Entropy: −(0.5·log₂0.5 + 0.5·log₂0.5) = 1.0 bit
- Gini: 1 − (0.5² + 0.5²) = 0.5
- Classification error: 1 − 0.5 = 0.5
- All three measures = 0
- Higher grades + faster learning
- Never study anything twice
- 100% sure, 100% understanding
What is the key behavioural difference between classification error and the other two measures?
What is the gain criterion Δ? Write the formula.
Δ = I(parent) − Σⱼ (N(vⱼ)/N) · I(vⱼ)
Where:
- I(parent) = impurity of the parent node
- N(vⱼ) = number of records in child j
- N = total records at parent
- I(vⱼ) = impurity of child j
Why does Information Gain favour high-cardinality attributes? Give an example.
But it has zero predictive power: the model has memorised training IDs, not learned a general pattern. It will fail completely on unseen records with new IDs.
What is Gain Ratio? How does it penalise high-cardinality attributes?
Split Info = −Σⱼ (N(vⱼ)/N) · log₂(N(vⱼ)/N)
Split Info is the entropy of the attribute's own value distribution. If an attribute creates many partitions (high cardinality), its Split Info is high — dividing by it reduces the Gain Ratio and penalises that attribute. Used by C4.5.
The question on the page originate from the summary of the following study material:
- A unique study and practice tool
- Never study anything twice again
- Get the grades you hope for
- 100% sure, 100% understanding

















