Learn how decision trees and tree-based ensembles work under the hood, and how to train and tune them in practice. From single decision trees and random forests, to AdaBoost, gradient boosting, XGBoost, LightGBM and CatBoost.
This repository contains the practical notebooks for the Master Tree Ensemble Models course. The examples cover classification and regression, using scikit-learn, XGBoost, LightGBM, and CatBoost.
Course launch: November 2026
Status: Actively maintained
- Understand how decision trees find splits, when to stop growing them, and how they produce predictions.
- Build ensembles with bagging and random forests, and understand why decorrelating trees works.
- Understand boosting, from AdaBoost to gradient boosting, and implement both from scratch.
- Learn what makes XGBoost, LightGBM and CatBoost fast and accurate: regularized losses, split-finding algorithms, histogram-based learning, GOSS, EFB, ordered boosting and more.
- Tune the key hyperparameters of each library and train models for classification and regression.
- Explore advanced topics like DART and gradient boosting with imbalanced data.
-
Decision Trees — notebooks
- How decision trees work
- Tree induction: selecting features and split values
- Pruning and stopping tree growth
- Training classification and regression trees
-
Bagging and Random Forests — notebooks
- Foundations of ensemble models
- Bagging
- Random forests and decorrelating the trees
- Training classification and regression random forests
-
Boosting — notebooks
- AdaBoost: intuition, algorithm and exponential loss
- Gradient boosting: steepest descent, residuals and the algorithm
- Training GBMs for classification and regression
-
XGBoost — notebooks
- Regularized loss function and split gain
- Split finding: exact greedy and approximate algorithms
- Weighted quantile sketch and sparsity-aware split finding
- Feature importance
- Hyperparameters
- Training XGBoost for classification and regression
-
LightGBM — notebooks
- Histogram-based split algorithm
- Gradient-based One-Side Sampling (GOSS)
- Exclusive Feature Bundling (EFB)
- Leaf-wise tree growth
- Hyperparameters
- Training LightGBM for classification and regression
-
CatBoost — notebooks
- Target statistics and conditional shift
- Ordered target statistics
- Oblivious trees
- Prediction shift and ordered boosting
- Feature combination
- Hyperparameters
- Training CatBoost for classification and regression
Clone the repository (Python 3.12+ required), then set up a dedicated environment with either of the options below.
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
jupyter notebookuv sync
uv run jupyter notebookOpen the notebooks in numerical order.
For lectures, explanations, and the complete learning path, visit the online course.
