Use of scale_pos_weight

Hi, I have an imbalanced dataset and was trying to use scale_pos_weight. I wanted to ask does it penalise only the misclassified observations or all the observation of positive class. Since it multiplies the gradient and hessian with the parameter value, won’t it increase the gradient and hessian for correctly classified labels as well.

Thanks!!

1 Like

It will weigh all samples of positive class, irrespective of what they are classified as.
Think of it as considering samples to be repeated when it multiplies the gradient and hessian, ie, oversampling. Do ask if you have any further questions on this explanation.