Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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)
Source by datascience.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #sample #weights #fit #model #multiclass
ADD COMMENT
Topic
Name
5+7 =