-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Enforce positive sample_weight #15531
Copy link
Copy link
Open
Labels
Description
As discussed in #12464 (comment) and #15358 (comment) in some specific use-cases negative sample_weight may be meaningful, however in most cases they should never happen.
So we may want to
- add
force_positive=Noneparameter to_check_sample_weights. - add a
assume_positive_sample_weights=Trueconfig parameter tosklearn.set_config/get_config.
By default, force_positive=None would error on negative sample weight, but this check could be disabled globally with sklearn.set_config(assume_positive_sample_weights=False).
With _check_sample_weights(.., force_positive=True) the check would always be done irrespective of the config parameter.
If there are no objections to this, please tag this issue as "Help Wanted".
Reactions are currently unavailable