Closed alxhslm closed 5 months ago
I don't think we'd be adding this for all tree based models. But we'll be moving HistGradientBoosting under general GradientBoosting most probably. (https://github.com/scikit-learn/scikit-learn/issues/27873)
cc @adam2392 @lorentzenchr @glemaitre
Describe the workflow you want to enable
Instead of passing an array of monotonicity constraints (-1 for a decrease constraint, +1 for an increase constraint or 0 for no constraint) specified by feature positions in the training set, it would be more convenient to pass a dict to pass constraints spec only for the required feature names. For instance
Not that here X has column names because it is a
pd.DataFrame
.Note that this already supported for
HistGradientBoostingRegressor
. Ideally this would be supported across all tree-based models for consistency.Describe your proposed solution
Use the
_check_monotonic_cst
function to validate themonotonic_cst
argument in all estimators.Describe alternatives you've considered, if relevant
This has already been implemented for
HistGradientBoostingRegressor
in #24855.Additional context
See #24855 for the implementation of this for
HistGradientBoostingRegressor
.