Skip to content

interpret/ebm-monotonize-with-interactions

Pack Severity Fix Versions
interpret warning none, edit by hand All versions

ExplainableBoostingClassifier.monotonize() and ExplainableBoostingRegressor.monotonize() apply isotonic regression only to a single univariate main-effect term and do not modify pairwise interaction terms. Because EBMs default to interactions="5x", calling monotonize() without interactions=0 (or excluding pairwise terms involving that feature) allows pairwise interactions to reverse the feature's slope and silently break global monotonicity.

ebm = ExplainableBoostingRegressor(random_state=0).fit(X_train, y_train)
ebm = ExplainableBoostingRegressor(interactions=0, random_state=0).fit(X_train, y_train)
ebm.monotonize(0, increasing=True)

Calls to ebm.monotonize(...) when ebm was constructed as an ExplainableBoostingClassifier or ExplainableBoostingRegressor without interactions=0 (or exclude=...).

Pass interactions=0, pass exclude=... to drop pairwise terms involving the constrained feature, or enforce monotonicity during training with monotone_constraints=[...] (which automatically excludes constrained features from interactions).

Calling $M.monotonize(...) only adjusts univariate shape terms and leaves pairwise EBM interaction terms unmodified (default interactions="5x"), which silently breaks global monotonicity. Set interactions=0 (or exclude pairwise interactions involving the constrained feature) or pass monotone_constraints at fit time.

See all rules in the interpret pack.