use sample weights fit model multiclass

The solution for “use sample weights fit model multiclass” can be found here. The following code will assist you in solving the problem.

from sklearn.utils import class_weight

class_weights = class_weight.compute_class_weight(‘balanced’,
y_train), y_train, class_weight=class_weights)

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

inline scripts encapsulated in