You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 (when those are available as str values in the dataset columns). For instance
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 or0
for no constraint) specified by feature positions in the training set, it would be more convenient to pass adict
to pass constraints spec only for the required feature names (when those are available asstr
values in the dataset columns). For instanceNot that here X has column names because it is a pandas dataframe.
See #24845 for a similar feature for
interaction_cst
by passing a list of tuple ofstr
names instead.Describe your proposed solution
This requires updating the
fit
method, docstring and examples to accept a dict of constraints with feature names as keys.If
feature_names_in_
is not defined infit
, then a value error with a helpful error message must be raised.Describe alternatives you've considered, if relevant
No response
Additional context
Once #13649 is finalized and merged, a similar treatment should be adapted to it for the sake of consistency.
The text was updated successfully, but these errors were encountered: