rules/interpret/ebm-monotonize-with-interactions.md

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.

diff
1-ebm = ExplainableBoostingRegressor(random_state=0).fit(X_train, y_train)
2+ebm = ExplainableBoostingRegressor(interactions=0, random_state=0).fit(X_train, y_train)
3 ebm.monotonize(0, increasing=True)

What the rule reports

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

How to fix it

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).