ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing
ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing

All Courses

Mastering Gradient Boosting Algorithms
Chapter 1: Gradient Boosting Foundations Revisited
Ensemble Methods: A Recap
Decision Trees as Base Learners
The Additive Modeling Framework
Gradient Descent Fundamentals
Introducing the Gradient Boosting Machine (GBM)
Chapter 2: The Gradient Boosting Algorithm in Depth
Functional Gradient Descent
Deriving the Generic GBM Algorithm
Common Loss Functions for Regression
Common Loss Functions for Classification
The Role of Shrinkage (Learning Rate)
Subsampling Techniques (Stochastic Gradient Boosting)
Implementing GBM with Scikit-learn
Practice: Building a Basic GBM Model
Chapter 3: Regularization in Gradient Boosting
Overfitting Challenges in Boosting
Tree Constraints: Depth, Nodes, and Splits
Shrinkage as Implicit Regularization
Subsampling (Stochastic Gradient Boosting)
Regularized Objective Functions (L1/L2)
Early Stopping Strategies
Hands-on Practical: Applying Regularization
Chapter 4: XGBoost: Extreme Gradient Boosting
Motivation and Enhancements over GBM
The Regularized Learning Objective
Split Finding Algorithm: Exact Greedy
Split Finding Algorithm: Approximate Greedy
Sparsity-Aware Split Finding
System Optimizations: Cache Awareness and Parallelism
XGBoost API: Parameters and Configuration
Hands-on Practical: Implementing XGBoost
Chapter 5: LightGBM: Light Gradient Boosting Machine
Motivation: Addressing XGBoost's Limitations
Gradient-based One-Side Sampling (GOSS)
Exclusive Feature Bundling (EFB)
Histogram-Based Split Finding
Leaf-Wise Tree Growth
Optimized Categorical Feature Handling
LightGBM API: Parameters and Configuration
Hands-on Practical: Implementing LightGBM
Chapter 6: CatBoost: Gradient Boosting on Decision Trees
Motivation: Challenges with Categorical Data
Ordered Target Statistics (Ordered TS)
Addressing Prediction Shift: Ordered Boosting
Handling Feature Combinations
Oblivious Trees
GPU Training Acceleration
CatBoost API: Parameters and Configuration
Hands-on Practical: Implementing CatBoost
Chapter 7: Advanced Topics and Customization
Model Interpretability with SHAP
TreeSHAP for Gradient Boosting Models
Global vs. Local Explanations
Probability Calibration for Classification
Implementing Custom Loss Functions
Implementing Custom Evaluation Metrics
Handling Imbalanced Datasets with Boosting
Practice: Custom Objectives and SHAP
Chapter 8: Hyperparameter Optimization Strategies
The Importance of Hyperparameter Tuning
Identifying Critical Hyperparameters
Systematic Tuning: Grid Search and Randomized Search
Advanced Tuning: Bayesian Optimization
Hyperparameter Optimization Frameworks (Optuna, Hyperopt)
Tuning Strategy: From Coarse to Fine
Cross-Validation Strategies for Tuning
Hands-on Practical: Advanced Tuning with Optuna
Chapter 9: Gradient Boosting for Specialized Tasks
Learning to Rank with Gradient Boosting
Ranking Objective Functions (Pairwise, Listwise)
Survival Analysis with Gradient Boosting
Survival Objective Functions (Cox PH)
Quantile Regression with Gradient Boosting
Quantile Loss Function Implementation
Multi-Output Gradient Boosting
Practice: Implementing Ranking with XGBoost

Split Finding Algorithm: Approximate Greedy

An exact greedy algorithm can guarantee finding the optimal split among all possible values for continuous features (given the current tree structure). However, its computational demands can become prohibitive for large datasets. Evaluating every unique value as a potential split point requires sorting the feature values at each node, an operation that scales poorly, typically with O(nlog⁡n)O(n \log n)O(nlogn) complexity where nnn is the number of instances in the node. Furthermore, repeatedly accessing and sorting potentially large amounts of data can lead to cache misses and memory bottlenecks.

To address these scalability challenges, XGBoost introduces an approximate greedy algorithm. This approach significantly speeds up the split finding process, especially for large datasets, by reducing the number of candidate split points evaluated.

The Histogram-Based Strategy

The core idea behind the approximate algorithm is to discretize continuous features into a limited number of bins before training or at different stages during training. Instead of examining every unique feature value as a potential split point, the algorithm only examines split points between these discrete bins.

Here's how it works:

  1. Feature Binning (Quantization): For each continuous feature, the algorithm groups the sorted values into a fixed number of discrete bins. This is typically done using quantiles (percentiles) of the feature's distribution. For example, if we choose 256 bins, the algorithm finds approximately 255 split points that divide the data into 256 roughly equal-sized groups based on that feature's values.
  2. Aggregated Statistics: For each bin, XGBoost calculates and stores the sum of gradients (GGG) and Hessians (HHH) for all data points falling into that bin. Let IkI_kIk​ be the set of indices of data points whose feature value falls into bin kkk. Then, the aggregated statistics for bin kkk are: Gk=∑i∈IkgiG_k = \sum_{i \in I_k} g_iGk​=∑i∈Ik​​gi​ Hk=∑i∈IkhiH_k = \sum_{i \in I_k} h_iHk​=∑i∈Ik​​hi​
  3. Evaluating Candidate Splits: The algorithm then evaluates potential splits only at the boundaries between bins. To calculate the gain of a split proposed between bin jjj and bin j+1j+1j+1, it efficiently uses the pre-computed sums. The total gradient and Hessian for the left child (LLL, containing bins 1...j1...j1...j) and right child (RRR, containing bins j+1...Nbinsj+1...N_{bins}j+1...Nbins​) are simply: GL=∑k=1jGk,HL=∑k=1jHkG_L = \sum_{k=1}^{j} G_k, \quad H_L = \sum_{k=1}^{j} H_kGL​=∑k=1j​Gk​,HL​=∑k=1j​Hk​ GR=∑k=j+1NbinsGk,HR=∑k=j+1NbinsHkG_R = \sum_{k=j+1}^{N_{bins}} G_k, \quad H_R = \sum_{k=j+1}^{N_{bins}} H_kGR​=∑k=j+1Nbins​​Gk​,HR​=∑k=j+1Nbins​​Hk​ These aggregate values are then plugged into the standard gain formula: Gain=12[GL2HL+λ+GR2HR+λ−(GL+GR)2HL+HR+λ]−γGain = \frac{1}{2} \left[ \frac{G_L^2}{H_L + \lambda} + \frac{G_R^2}{H_R + \lambda} - \frac{(G_L+G_R)^2}{H_L+H_R + \lambda} \right] - \gammaGain=21​[HL​+λGL2​​+HR​+λGR2​​−HL​+HR​+λ(GL​+GR​)2​]−γ The algorithm finds the boundary between bins that maximizes this gain.

A continuous feature's values are mapped into discrete bins. Each bin aggregates the gradient (GGG) and Hessian (HHH) statistics of the instances it contains. Potential splits are evaluated only at the boundaries between these bins.

Proposal Methods: Global vs. Local Variants

XGBoost offers two primary variants for when these candidate split points (bin boundaries) are determined:

  1. Global Variant: The candidate split points are proposed once at the beginning of the entire tree construction process (or even before training starts). The same set of proposals (bin boundaries) is used for evaluating splits at all nodes throughout the growth of a specific tree. This is computationally cheaper as the binning process happens only once per feature.
  2. Local Variant: The candidate split points are re-proposed after each split. That is, for a given node, the algorithm examines only the data points present in that node, re-calculates the feature quantiles based on this subset, determines new bin boundaries, and proposes splits based on these locally relevant boundaries. This is more computationally intensive as binning happens repeatedly, but it can potentially lead to more accurate splits, especially deeper in the tree where the data distribution might differ significantly from the global distribution.

The choice between global and local variants involves a trade-off:

  • Global: Faster training, less memory usage (proposals stored once). May be less accurate if data distributions change significantly within different branches of the tree.
  • Local: More computationally expensive, potentially higher memory usage. Adapts better to local data distributions, potentially leading to better accuracy, especially for deeper trees.

In practice, the global variant is often sufficient and provides significant speedups. The number of bins acts as a regularization parameter itself; fewer bins lead to coarser splits and potentially faster, more regularized models, while more bins allow finer splits, approaching the exact greedy method at the cost of increased computation. The parameter controlling this granularity in XGBoost is often related to sketch_eps (epsilon), where roughly 1 / sketch_eps gives the number of bins.

By using histograms and evaluating splits only between bins, the approximate greedy algorithm changes the split finding complexity from being dependent on the number of unique values to being dependent on the number of bins, which is typically much smaller. This makes XGBoost significantly faster and more memory-efficient, enabling it to handle datasets that are too large for the exact greedy algorithm.

  • XGBoost: A Scalable Tree Boosting System, Tianqi Chen, Carlos Guestrin, 2016 Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (ACM) DOI: 10.1145/2939672.2939785 - Introduces and details the approximate greedy algorithm, including the histogram-based strategy and discussions on global and local variants for split finding.
  • Tree Methods, XGBoost Contributors, 2024 - Explains the hist tree method, which implements the approximate greedy algorithm using histograms, and discusses parameters influencing binning.
  • LightGBM: A Highly Efficient Gradient Boosting Decision Tree, Guolin Ke, Qi Meng, Thomas Finley, Taifeng Wang, Wei Chen, Weidong Ma, Qiwei Ye, and Tie-Yan Liu, 2017 Advances in Neural Information Processing Systems (NIPS) 30 (Curran Associates, Inc.) - Presents another widely used gradient boosting framework that heavily relies on optimized histogram-based algorithms for efficient split finding, providing complementary insights into the technique.

© 2026 ApX Machine Learning