Implementation:Interpretml Interpret Feature Bin Metadata
| Knowledge Sources | |
|---|---|
| Domains | Machine_Learning, EBM_Core |
| Last Updated | 2026-02-07 12:00 GMT |
Overview
Defines the FeatureBoosting and FeatureInteraction POD classes that store feature metadata (bin count, missing/unseen/nominal flags) for the EBM native library.
Description
The Feature.hpp header declares two feature metadata classes. FeatureBoosting stores the number of bins (m_cBins) and boolean flags for whether missing values exist (m_bMissing), whether unseen categories exist (m_bUnseen), and whether the feature is nominal (m_bNominal). FeatureInteraction extends this with an additional m_cBitsRequiredMin field computed from the bin count, which is used to determine the minimum number of bits needed to represent a bin index for bit-packing purposes. Both classes are POD types with explicit delete of new/delete operators (using only malloc/free), and static assertions verify they are standard layout, trivial, and POD.
Usage
Created during boosting and interaction initialization. Feature objects are stored in arrays within BoosterCore and InteractionCore, providing the metadata needed for bit-packing, histogram sizing, and transpose operations throughout the EBM training process.
Code Reference
Source Location
- Repository: Interpretml_Interpret
- File: shared/libebm/Feature.hpp
Signature
class FeatureBoosting final {
inline void Initialize(const size_t cBins, const bool bMissing,
const bool bUnseen, const bool bNominal) noexcept;
inline size_t GetCountBins() const noexcept;
inline bool IsMissing() const noexcept;
inline bool IsUnseen() const noexcept;
inline bool IsNominal() const noexcept;
};
class FeatureInteraction final {
inline void Initialize(const size_t cBins, const bool bMissing,
const bool bUnseen, const bool bNominal) noexcept;
inline int GetBitsRequiredMin() const noexcept;
inline size_t GetCountBins() const noexcept;
inline bool IsMissing() const noexcept;
inline bool IsUnseen() const noexcept;
inline bool IsNominal() const noexcept;
};
I/O Contract
| Field | Description |
|---|---|
| cBins | Number of discrete bins for this feature |
| bMissing | Whether a missing-value bin exists |
| bUnseen | Whether an unseen-category bin exists |
| bNominal | Whether the feature is categorical (nominal) |
| cBitsRequiredMin | Minimum bits to represent bin index (FeatureInteraction only) |
Usage Examples
# Called internally via native bindings
from interpret.glassbox import ExplainableBoostingClassifier
ebm = ExplainableBoostingClassifier()
ebm.fit(X, y) # Feature metadata is created internally for each input feature