LightGBM (Light Gradient-Boosting Machine) is the sixth and final classifier in the FFD pipeline. Designed by Microsoft Research, it combines histogram-based split finding with a leaf-wise tree growth strategy to deliver training speeds significantly faster than XGBoost on large tabular datasets — while matching or exceeding its accuracy. On the GAN-augmented ~51k-sample credit card dataset it converges quickly and produces a compact, interpretable model.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Antisource/FFD/llms.txt
Use this file to discover all available pages before exploring further.
How LightGBM Works
LightGBM departs from classical gradient boosting in two important ways:Histogram-based split finding
Instead of sorting feature values at every node (O(n log n) per feature), LightGBM bins continuous features into at mostmax_bin (default 255) discrete histogram buckets at the start of training. Split candidates are evaluated by summing pre-computed gradient statistics per bucket — reducing the cost to O(max_bin) per feature per node, regardless of dataset size.
Leaf-wise tree growth
Most boosting libraries grow trees level-wise (breadth-first), expanding all nodes at the same depth before moving deeper. LightGBM grows trees leaf-wise (best-first): at each step it expands the leaf that yields the largest loss reduction, regardless of depth. This means:- Fewer nodes are evaluated to achieve the same loss reduction.
- Trees can be deeper and more asymmetric — capturing complex fraud sub-patterns efficiently.
- The risk of overfitting is higher on small datasets; control with
num_leavesandmin_child_samples.
- GOSS (Gradient-based One-Side Sampling) — keeps all high-gradient (informative) samples and a random subset of low-gradient ones, reducing data size without significant accuracy loss.
- EFB (Exclusive Feature Bundling) — packs mutually exclusive features into a single bundle, reducing effective feature count.
- Native categorical feature support — though the FFD dataset does not have categorical features, this matters for raw transaction data upstream of PCA.
Implementation
The notebook instantiatesLGBMClassifier with a fixed random seed and default hyperparameters:
LightGBM may emit verbose log output during training. Suppress it by passing
verbosity=-1 to the constructor, or set the environment variable
LIGHTGBM_VERBOSITY=-1 before importing the library.Key Hyperparameters
| Parameter | Default | Guidance |
|---|---|---|
n_estimators | 100 | Number of boosting rounds. Combine with early_stopping_rounds on a validation set for automatic stopping. |
num_leaves | 31 | Maximum number of leaves per tree. The primary control for model complexity in leaf-wise growth. Keep num_leaves < 2^max_depth. |
learning_rate | 0.1 | Step-size shrinkage. Lower values (e.g. 0.05) need more rounds but often generalise better. |
min_child_samples | 20 | Minimum samples required in a leaf. Raise to 50–100 to prevent leaves that contain only a handful of fraud transactions. |
max_depth | -1 (unlimited) | Cap to 6–8 when num_leaves is large, to prevent excessively deep paths. |
subsample | 1.0 | Fraction of rows sampled per iteration (requires subsample_freq > 0). Values of 0.7–0.9 add useful stochasticity. |
colsample_bytree | 1.0 | Fraction of features sampled per tree. |
is_unbalance | False | Set to True to automatically weight the minority fraud class by the inverse class frequency ratio. |
class_weight | None | Alternative to is_unbalance: supply a dict e.g. {0: 1, 1: 101} for fine-grained control. |
random_state | 42 | Reproducibility seed used in the notebook. |
Evaluation
See Also
Training Pipeline
End-to-end pipeline: data loading, GAN augmentation, train/test split, and unified evaluation loop.
Metrics Reference
Definitions of accuracy, precision, recall, and F1 as used across all six FFD classifiers.