Solved by KFrank in post #2 
              
              
                Hi Mr. Bing! 

There is no single right answer for choosing weights to reweight an 
unbalanced data set.  But a good starting point is: 
weight_for_class = 1 / number_of_samples_in_class. 
The idea is that you might want each class to be making about the 
same overall contribution to the loss functi…