Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Interpretml Interpret DataSetInteraction Hpp

From Leeroopedia


Knowledge Sources
Domains Machine_Learning, EBM_Core
Last Updated 2026-02-07 12:00 GMT

Overview

Defines the DataSubsetInteraction and DataSetInteraction structures that hold data for the EBM interaction detection process.

Description

The DataSetInteraction.hpp header declares two data structures for interaction detection. DataSubsetInteraction holds a single SIMD-aligned data subset containing sample count, objective wrapper pointer, gradient/hessian arrays, per-feature packed data arrays, and sample weights. It provides methods for applying objective updates (ObjectiveApplyUpdate) and computing interaction bin sums (BinSumsInteraction). DataSetInteraction is the top-level container holding multiple subsets, total sample count, total weight, and methods for initialization/destruction. Unlike DataSetBoosting, this structure does not need term-specific data or inner bags since interaction detection operates on individual features rather than terms.

Usage

Created during interaction detection initialization. The InteractionCore holds a DataSetInteraction to store the full dataset for computing interaction strengths between feature pairs. Each call to CalcInteractionStrength uses this data to build multi-dimensional histograms.

Code Reference

Source Location

Signature

struct DataSubsetInteraction final {
   inline void SafeInitDataSubsetInteraction();
   void DestructDataSubsetInteraction(const size_t cFeatures);
   inline size_t GetCountSamples() const;
   inline const ObjectiveWrapper* GetObjectiveWrapper() const;
   inline ErrorEbm ObjectiveApplyUpdate(ApplyUpdateBridge* const pData);
   inline ErrorEbm BinSumsInteraction(BinSumsInteractionBridge* const pParams);
   inline void* GetGradHess();
   inline const void* GetFeatureData(const size_t iFeature) const;
   inline const void* GetWeights() const;
};

struct DataSetInteraction final {
   inline void SafeInitDataSetInteraction();
   void DestructDataSetInteraction(const size_t cFeatures);
   inline size_t GetCountSamples() const;
   inline size_t GetCountSubsets() const;
   inline DataSubsetInteraction* GetSubsets();
   inline double GetWeightTotal() const;
};

I/O Contract

Component Description
DataSubsetInteraction.m_cSamples Number of samples in this subset
DataSubsetInteraction.m_pObjective Objective function pointer
DataSubsetInteraction.m_aGradHess Per-sample gradient/hessian storage
DataSubsetInteraction.m_aaFeatureData Per-feature packed bin data
DataSubsetInteraction.m_aWeights Per-sample weights (optional)

Usage Examples

# Called internally via native bindings
from interpret.glassbox import ExplainableBoostingClassifier
ebm = ExplainableBoostingClassifier(interactions=10)
ebm.fit(X, y)  # DataSetInteraction holds data for interaction detection

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment