New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the mechanism of using param ‘scale_pos_weight’? #1299
Comments
This answer is for XGBoost but it should be the same for both implmentations. If you're still unsure, I think 'is_unbalance' essentially does the same thing but calculates 'scale_pos_weight' by itself. |
Thanks @bbennett36 |
@pranavpandya84 From the document we can see scale_pos_weight, default=1.0, type=double With the default value of '1', it implies that the positive class has a weight equal to the negative class. So, in your case as the positive class is less than the negative class the number should have been less than '1' and not more than '1'. This is just my understanding and I may not be correct... |
For both xgboost and LightGBM,
which also means the following when using weights through
Therefore, its value, if asking for balance, is the following:
More simple explanation: https://sites.google.com/view/lauraepp/parameters and type "scale" in the search box, then click on "Positive Binary Scaling". Related C++ code:
|
Thanks a lot. Perfect! |
It seems that XGBoost and LightGBM both have
scale_pos_weight
argument but calculation is done completely different. I couldn't find any authentic answer regarding how to calculate it in LightGBM so requesting it here.I'm using following method to calculate scale_pos_weight. I am not sure if it's correct.
The text was updated successfully, but these errors were encountered: