RiskBands
Binning for credit risk with a focus on temporal robustness. RiskBands helps move from a static IV reading to a more defensible decision across separation, stability, and auditability.
What RiskBands is
Section titled “What RiskBands is”RiskBands is a Python library for building, comparing, and auditing binning candidates when the real question is not only “which cut has the highest IV?”, but:
which solution remains more defensible when time becomes part of the analysis?
It was designed for cases such as:
- PD models
- credit scorecards
- vintage or cohort analysis
- variables with temporal drift
- structures with rare bins, fragile coverage, or ranking reversals
Why use it
Section titled “Why use it”OptimalBinning already solves static cuts very well. RiskBands helps decide
whether that cut is still the best answer when behavior is opened by period.
In practice, the project adds:
- temporal diagnostics by variable, bin, and period
- a temporal-robustness-oriented score with the
stablestrategy - candidate comparison through
BinComparator - auditable reports explaining why a candidate won
Recommended path for a new user
Section titled “Recommended path for a new user”- Install the Python package.
- Run the Quickstart.
- Read Score and strategies to understand
stable. - Read Missing policy if your data contains missing values.
- Use Outputs and diagnostics to learn how to read the result.
- Continue with Examples or the methodology pages in the pt-BR documentation.
Minimal flow
Section titled “Minimal flow”from riskbands import RiskBands
binner = RiskBands( strategy="supervised", score_strategy="stable", max_n_bins=5, check_stability=True, missing_policy="standard",)
binner.fit(df, y="target", column="score", time_col="month")summary = binner.summary()score_details = binner.score_details()What makes the stable score different
Section titled “What makes the stable score different”stable does not choose the best candidate only by static IV.
It combines:
- temporal variance of shrunken WoE
- drift between windows
- ranking inversions between bins
- separation
- entropy
- PSI
All of these are combined in a comparable minimization-oriented objective.
Next steps
Section titled “Next steps”- Want to start using it? Go to Quickstart.
- Need to audit missing values? Go to Missing policy.
- Want to understand the recommended strategy? Go to Score and strategies.
- Want the public API map? Go to API overview.