Description
Noticed while working on: #31701
_check_sample_weight
gives the following error message:
scikit-learn/sklearn/utils/validation.py
Lines 2207 to 2208 in 9489ee6
I don't think sample weights can ever be a scalar. Indeed later we check:
scikit-learn/sklearn/utils/validation.py
Lines 2210 to 2213 in 9489ee6
So it actually can't be a scalar.
Just to be sure I searched for "weight :" and "weights :" in our docstrings and found that we always ask for and ndarray for sample_weights
.
For clustering weights
is a string or callable. In the times where weights can be a scalar (e.g., in VotingRegressor
or 'class_weights', we never use _check_sample_weight
.)