q.label.class_balance_weights assigns inverse-frequency factors so every observed class receives equal total weight. The resulting factors have unit mean.
Use class balancing when the training objective should not be dominated by the majority target. It changes the loss contribution, not the labels themselves.