Hi Amir!



 amirhf:

I wonder how you calculated this:


Yes, this was not meant to be a realistic calculation.  I was illustrating
an oversimplified estimate of the class weights based on the single
data point you provided.
The (unrealistic) details:  Out of the 54 binary labels in your target,
six were positive.  If one assumes (without any evidence) that positive
labels occur equally frequently for all 54 classes, and further assumes
(again, without any evidence) that the single target you gave is in
some sense randomly representative of all of your targets, then one
would conclude that, across your ensemble of targets, any given
class is labelled positive about one time in nine.
Under these assumptions, you would want to use the same value
of 9.0 for the pos_weight for all of your 54 classes.
Of course, these assumptions are probably not correct, so you should
look at a representative sample of your training data to determine the
per-class pos_weight values.
Best.
K. Frank