Answers for "use sample weights fit model multiclass"

0

use sample weights fit model multiclass

from sklearn.utils import class_weight


class_weights = class_weight.compute_class_weight('balanced',
                                                 np.unique(y_train),
                                                 y_train)


model.fit(X_train, y_train, class_weight=class_weights)
Posted by: Guest on February-20-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language