Yes the weights are precomputed, based on class frequencies. But yes the issue you pointed out is same as mine. Your discussion on the issue also clarifies to me what is going on, so thank you really much for the help  .