Base Classes
Foundation classes that provide core functionality for all binning methods.
Quick Reference
|
Clean binning base class focusing on orchestration and guidance logic. |
|
Interval-based binning functionality inheriting from GeneralBinningBase. |
|
Base class for flexible binning methods that support mixed bin types. |
|
Base class for supervised binning methods that use target information. |
Base Class Hierarchy
The binlearn library uses a hierarchical inheritance structure:
GeneralBinningBase - Root base class for all binning methods
Provides core transformer interface (fit/transform)
Handles DataFrame preservation and column management
Implements common validation and error handling
IntervalBinningBase - Base for interval-based methods
Extends GeneralBinningBase with interval-specific functionality
Handles bin edges, representatives, and clipping
Used by: EqualWidthBinning, EqualFrequencyBinning, KMeansBinning, etc.
FlexibleBinningBase - Base for flexible binning methods
Extends GeneralBinningBase with mixed bin type support
Handles both singleton and interval bins
Used by: SingletonBinning, ManualFlexibleBinning
SupervisedBinningBase - Base for supervised methods
Extends IntervalBinningBase with target-aware functionality
Handles guidance data and supervised learning integration
Used by: TreeBinning, Chi2Binning, IsotonicBinning
Purpose and Usage
These base classes provide:
Consistent Interface: All binning methods share the same API
Code Reuse: Common functionality implemented once
Type Safety: Proper inheritance and method signatures
Extensibility: Easy to add new binning methods
Validation: Comprehensive parameter and data validation
Users typically don’t interact with base classes directly, but they provide the foundation that makes all binning methods work consistently together.