Use of scale_pos_weight


#1

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!!


#2

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.