liveBook · Manning

LightGBM

As explained in Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

LightGBM is an open-source gradient-boosting framework designed for efficient tree-based learning.

LightGBM is an open-source, cross-platform gradient-boosting library for tree-based classification and regression on tabular data. Its design emphasizes faster training and lower memory use than traditional gradient-boosted decision trees, making it a strong candidate when iterative experimentation matters. section 5.5 section 5.0

Its defining tree-growth policy is leaf-wise, or best-first. At each step, it splits the leaf with the greatest loss reduction rather than splitting every node at a given depth. Under stopping limits, this can produce smaller trees, faster training, and higher accuracy; it can also create deeper trees that overfit, especially on small datasets. section 5.5.1 section 6.4.1

LightGBM is commonly chosen or controlled through these practical considerations:

  • Use it as a gradient-boosted-tree option for tabular problems, alongside XGBoost and HistGradientBoosting; test alternatives on the actual data rather than assuming one algorithm always wins. section 6.4.1
  • Favor it for fast CPU experimentation when compute resources are limited; XGBoost is described as more scalable and more GPU-ready in larger institutional settings. section 6.4.1
  • Constrain growth to manage overfitting. LightGBM offers max_depth and num_leaves, with max_leaves available as an alias for num_leaves. section 5.5.4
  • Handle missing values by assigning them at each split to the side that minimizes loss, allowing missingness patterns to affect predictions when useful. section 6.1.2

Cross-validated classifier pipeline

Create an LGBMClassifier with gradient-boosted trees, place it after column preprocessing in a Pipeline, and evaluate it with five-fold cross-validation. The illustrated setup uses 300 estimators, unrestricted depth, a minimum of three samples per child, and column-wise processing; it reports mean accuracy as well as fit and prediction times. section 5.5

Early stopping can limit an oversized ensemble. Train with a validation set, monitor an evaluation metric, and stop after a chosen number of rounds without improvement. The best validation iteration is retained in best_iteration and used automatically for prediction. Callback-based early stopping additionally supports first_metric_only and min_delta controls. section 5.5.3

Figure 5.10 How level-wise (on the left) and leaf-wise (on the right) tree growth differ

Compare level-wise and leaf-wise growth paths under the same limit on terminal nodes to see why the policies can yield different constrained trees. section 5.5.1

LightGBM supports sparse data, categorical variables, GPU training, networked parallel training, monotonicity constraints, and missing values. Even so, large numbers of cases or features can still lengthen training; subsample and colsample_bytree can reduce the data or features considered per tree, trading possible model quality for speed. section 5.5 section 6.4.3

How Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI covers it

How deep it goes
Explains leaf-wise splitting, constraints, missing-value routing, pipeline evaluation, and callback-based early stopping without detailing EFB.
Examples
Uses an LGBMClassifier preprocessing pipeline with five-fold validation and a separate validation-set early-stopping setup.
What it assumes
Assumes familiarity with tabular machine learning, decision trees, preprocessing pipelines, and validation splits.
What you can do after
Apply it via LightGBM's LGBMClassifier, cross-validation, validation monitoring, and early-stopping callbacks.
How it connects
Connects gradient boosting with decision trees, XGBoost, HistGradientBoosting, early stopping, cross-validation, and missing values.

Also explained in

Compare how 2 books explain LightGBM →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI. The section links point to the parts of the book it draws on.