What is the role of the gamma hyperparameter in XGBoost tree pruning?

Quick Overview

Asks what the gamma hyperparameter does during tree pruning in XGBoost. Tests knowledge of the regularized objective, how the per-leaf penalty enters the split gain, when the threshold is applied under each tree method, and how to choose a value that fits the loss scale.

What is the role of the gamma hyperparameter in XGBoost tree pruning?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

What is the role of the `gamma` hyperparameter in XGBoost tree pruning? ```hint Price of a leaf Write out the regularization term in XGBoost's objective and ask what adding one more leaf costs. ``` ```hint Order of operations Think about when the threshold is checked relative to growing the tree. ``` ### What a Strong Answer Covers - The definition of gamma and its alias - Where gamma comes from in the regularized objective and how it enters the split gain - When the threshold is applied relative to tree growth, and whether a weak split can survive - Its effect on tree size, bias and variance, and how to pick a value ### Follow-up Questions - How do `gamma`, `lambda` and `min_child_weight` differ as regularizers? - Why does the same gamma prune less on a larger dataset? - A regression target is measured in dollars. If you switch it to thousands of dollars, what happens to a gamma that worked before?

Overview: Asks what the gamma hyperparameter does during tree pruning in XGBoost. Tests knowledge of the regularized objective, how the per-leaf penalty enters the split gain, when the threshold is applied under each tree method, and how to choose a value that fits the loss scale.

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

What is the role of the gamma hyperparameter in XGBoost tree pruning?

What a Strong Answer Covers Guidance

  • The definition of gamma and its alias
  • Where gamma comes from in the regularized objective and how it enters the split gain
  • When the threshold is applied relative to tree growth, and whether a weak split can survive
  • Its effect on tree size, bias and variance, and how to pick a value

Follow-up Questions Guidance

  • How do gamma , lambda and min_child_weight differ as regularizers?
  • Why does the same gamma prune less on a larger dataset?
  • A regression target is measured in dollars. If you switch it to thousands of dollars, what happens to a gamma that worked before?