What is Gini impurity?

Quick Overview

Asks you to define Gini impurity, give its formula and range, and explain how a decision tree uses it to pick splits. Tests whether you can compute node impurity by hand and compare candidate splits by their weighted impurity.

What is Gini impurity?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

What is Gini impurity, and how does a decision tree use it? ```hint A random-labeling game Draw one sample from a node, then give it a label drawn at random from that node's own class proportions. How often is the label wrong? ``` ### What a Strong Answer Covers - The definition and its probabilistic interpretation - The formula and its range for K classes - A worked computation for a simple node - How the measure is used to choose a split ### Follow-up Questions - How does Gini impurity compare with entropy as a split criterion, and do they usually produce different trees? - Why is plain misclassification error a poor split criterion even though it also measures how mixed a node is? - Is Gini impurity related to the Gini coefficient reported for credit and ranking models?

Overview: Asks you to define Gini impurity, give its formula and range, and explain how a decision tree uses it to pick splits. Tests whether you can compute node impurity by hand and compare candidate splits by their weighted impurity.

PracHub logo
General
Nov 24, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

What is Gini impurity, and how does a decision tree use it?

What a Strong Answer Covers Guidance

  • The definition and its probabilistic interpretation
  • The formula and its range for K classes
  • A worked computation for a simple node
  • How the measure is used to choose a split

Follow-up Questions Guidance

  • How does Gini impurity compare with entropy as a split criterion, and do they usually produce different trees?
  • Why is plain misclassification error a poor split criterion even though it also measures how mixed a node is?
  • Is Gini impurity related to the Gini coefficient reported for credit and ranking models?