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 CutUniform

From Leeroopedia
Revision as of 15:16, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Interpretml_Interpret_CutUniform.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


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

Overview

CutUniform is a C++ module that generates uniformly spaced cut points for feature discretization, along with cross-platform portable floating-point tick increment/decrement functions and a float cleaning utility.

Description

This module contains three key components:

  1. FloatTickIncrementInternal / FloatTickDecrementInternal: Cross-language portable implementations of nextafter that skip subnormal numbers per the EBM specification. These functions produce correct and reproducible results regardless of CPU rounding mode, flush-to-zero settings, or extended precision, requiring only IEEE-754 format representation.
  1. CleanFloats: An EBM API function that converts extended precision values to standard precision, converts subnormal values to zero, and converts negative zeros to positive zeros, ensuring cross-platform reproducibility.
  1. CutUniform: An EBM API function that generates uniformly spaced cut points between the minimum and maximum feature values. The algorithm is part of the EBM histogram specification and guarantees cross-platform reproducible results. It always returns the requested number of cuts unless the floating-point resolution between min and max is insufficient, in which case it fills every available position.

The uniform cutting algorithm works from both ends toward the center to maximize numerical precision, using a shifting technique to avoid subnormal arithmetic issues.

Usage

This module is used during the feature discretization (binning) phase of the EBM pipeline. It is called when uniform histogram bins are needed, which is the default strategy for continuous features. The float tick functions are also used throughout the library wherever precise floating-point boundary calculations are needed.

Code Reference

Source Location

Signature

extern double FloatTickIncrementInternal(double deprecisioned[1]) noexcept;

extern double FloatTickDecrementInternal(double deprecisioned[1]) noexcept;

EBM_API_BODY void EBM_CALLING_CONVENTION CleanFloats(
    IntEbm count,
    double* valsInOut);

EBM_API_BODY IntEbm EBM_CALLING_CONVENTION CutUniform(
    IntEbm countSamples,
    const double* featureVals,
    IntEbm countDesiredCuts,
    double* cutsLowerBoundInclusiveOut);

I/O Contract

Inputs

Name Type Required Description
countSamples IntEbm Yes Number of feature value samples
featureVals const double* Yes Array of feature values (may contain NaN for missing)
countDesiredCuts IntEbm Yes Desired number of uniform cut points
cutsLowerBoundInclusiveOut double* Yes Output buffer for cut points (must hold countDesiredCuts elements)

Outputs

Name Type Description
return value IntEbm Actual number of cuts placed in the output buffer
cutsLowerBoundInclusiveOut double* Array of lower-bound-inclusive cut points in ascending order

Usage Examples

Pipeline Context

# This C++ module is called internally via the native bindings
# during preprocessing to create uniform histogram bins
from interpret.glassbox import ExplainableBoostingClassifier
ebm = ExplainableBoostingClassifier()
ebm.fit(X, y)  # Internally calls CutUniform during discretization

Related Pages

Page Connections

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