Make it possible to specify monotonic_cst
with feature names in all tree-based estimators
#28850
Labels
monotonic_cst
with feature names in all tree-based estimators
#28850
Uh oh!
There was an error while loading. Please reload this page.
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
.The text was updated successfully, but these errors were encountered: