Implementation:Interpretml Interpret BinSumsBoosting
| Knowledge Sources | |
|---|---|
| Domains | Machine_Learning, EBM_Core |
| Last Updated | 2026-02-07 12:00 GMT |
Overview
Implements the histogram bin summation logic for the EBM boosting process, accumulating gradient and hessian statistics into feature bins.
Description
The BinSumsBoosting.hpp header contains the heavily templated BinSumsBoostingInternal function which is the core inner loop of the EBM boosting algorithm. It iterates over training samples, reading their gradients, hessians, and weights, and accumulates these statistics into histogram bins based on the bit-packed feature values. The implementation is specialized for multiple configurations: collapsed bins (single bin for intercept terms), single-score vs multi-score, parallel vs non-parallel binning, and various bit-packing sizes. The function uses SIMD-friendly data access patterns via the TFloat template parameter, which abstracts over scalar (CPU 64-bit), AVX2 (32-bit x8), and AVX-512 (32-bit x16) implementations.
Usage
Called during each boosting round to build histograms of gradient/hessian statistics per feature bin. These histograms are then used by the partition/split-finding algorithms to determine optimal split points for building the EBM additive model.
Code Reference
Source Location
- Repository: Interpretml_Interpret
- File: shared/libebm/compute/BinSumsBoosting.hpp
Signature
static constexpr int k_cItemsPerBitPackBoostingMax = 64;
static constexpr int k_cItemsPerBitPackBoostingMin = 1;
template<typename TFloat, bool bHessian, bool bWeight, bool bCollapsed,
size_t cCompilerScores, bool bParallel, int cCompilerPack,
typename std::enable_if<bCollapsed && 1 == cCompilerScores, int>::type = 0>
GPU_DEVICE NEVER_INLINE static void BinSumsBoostingInternal(
BinSumsBoostingBridge* const pParams);
// Additional specializations for:
// - Non-collapsed, single score, non-parallel
// - Non-collapsed, single score, parallel
// - Non-collapsed, multi-score
I/O Contract
| Input (via BinSumsBoostingBridge) | Description |
|---|---|
| m_cSamples | Number of samples to process |
| m_aGradientsAndHessians | Array of per-sample gradient (and hessian) values |
| m_aWeights | Per-sample weights (optional) |
| m_aPacked | Bit-packed feature bin indices |
| m_aFastBins | Output bin array to accumulate into |
| m_cScores | Number of scores per sample |
| Output | Description |
|---|---|
| m_aFastBins | Bins populated with accumulated gradient/hessian sums |
Usage Examples
# Called internally via native bindings
from interpret.glassbox import ExplainableBoostingClassifier
ebm = ExplainableBoostingClassifier()
ebm.fit(X, y) # BinSumsBoosting runs during each boosting iteration