Why does scikit-learn use Gini impurity as the default splitting criterion instead of entropy?

Quick Overview

Asks why scikit-learn decision trees split on Gini impurity by default and whether entropy would give different trees. Tests knowledge of the CART lineage, the math linking the two impurity measures, their computational cost, and which tree settings matter more.

Why does scikit-learn use Gini impurity as the default splitting criterion instead of entropy?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Why does scikit-learn use Gini impurity as the default splitting criterion instead of entropy? Say whether the choice changes the trees you get in practice, and when switching would be worth it. ```hint Compare the formulas Write both impurity measures for a node with class proportions $p_k$ and compare their shapes. Then think about how many times the tree evaluates one of them while it searches for a split. ``` ```hint Follow the lineage Ask which tree-learning algorithm scikit-learn implements and which criterion that algorithm was published with. ``` ### What a Strong Answer Covers - Whether the two criteria lead to different splits or different accuracy in practice - The cost of computing each criterion across all candidate thresholds - The algorithmic lineage: CART versus ID3 and C4.5 - The mathematical relation between Gini impurity and entropy - How to switch criteria, and how much that matters next to the other tree hyperparameters ### Follow-up Questions - Construct a split where Gini and entropy prefer different candidates. Why is the disagreement usually harmless? - Why does neither criterion use misclassification error to grow the tree? - Which criterion does scikit-learn use by default for regression trees, and what does it optimize? - If you switch from Gini to entropy, which other hyperparameters might need retuning?

Overview: Asks why scikit-learn decision trees split on Gini impurity by default and whether entropy would give different trees. Tests knowledge of the CART lineage, the math linking the two impurity measures, their computational cost, and which tree settings matter more.

General logo
General
Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

Why does scikit-learn use Gini impurity as the default splitting criterion instead of entropy?

Say whether the choice changes the trees you get in practice, and when switching would be worth it.

What a Strong Answer Covers Guidance

  • Whether the two criteria lead to different splits or different accuracy in practice
  • The cost of computing each criterion across all candidate thresholds
  • The algorithmic lineage: CART versus ID3 and C4.5
  • The mathematical relation between Gini impurity and entropy
  • How to switch criteria, and how much that matters next to the other tree hyperparameters

Follow-up Questions Guidance

  • Construct a split where Gini and entropy prefer different candidates. Why is the disagreement usually harmless?
  • Why does neither criterion use misclassification error to grow the tree?
  • Which criterion does scikit-learn use by default for regression trees, and what does it optimize?
  • If you switch from Gini to entropy, which other hyperparameters might need retuning?