You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our classification problem is often unbalanced, with some classes having much more samples than other.
If we are interested in evaluating the problem in a way that each class gets equal weight (macro average) we could consider training the model using weights per class. In sklearn, this is achieved by passing an array sample_weight when calling
model.fit(X, y, sample_weight)
where the sample_weight that gives more weight to under-represented classes can be easily computed using sklearn's compute_sample_weight.
The text was updated successfully, but these errors were encountered:
Our classification problem is often unbalanced, with some classes having much more samples than other.
If we are interested in evaluating the problem in a way that each class gets equal weight (
macro
average) we could consider training the model using weights per class. Insklearn
, this is achieved by passing an arraysample_weight
when callingwhere the
sample_weight
that gives more weight to under-represented classes can be easily computed usingsklearn
'scompute_sample_weight
.The text was updated successfully, but these errors were encountered: