compute_sample_weight
- sklearn.utils.class_weight.compute_sample_weight(class_weight, y, *, indices=None)
Estimate sample weights by class for unbalanced datasets.
- Parameters:
- class_weight : dict, list of dicts, “balanced”, or None
Weights associated with classes in the form
. If not given, all classes are supposed to have weight one. For multi-output problems, a list of dicts can be provided in the same order as the columns of y.