8.26.10. sklearn.preprocessing.balance_weights

sklearn.preprocessing.balance_weights(y)

Compute sample weights such that the class distribution of y becomes balanced.

Parameters :

y : array-like

Labels for the samples.

Returns :

weights : array-like

The sample weights.

Previous
Next