Commit 0241d323 authored by Guolin Ke's avatar Guolin Ke
Browse files

fix sumup too small when set unbalance=true

parent 5172b533
......@@ -47,8 +47,13 @@ public:
label_weights_[1] = 1.0f;
// if using unbalance, change the labels weight
if (is_unbalance_) {
if (cnt_positive > cnt_negative) {
label_weights_[1] = 1.0f;
label_weights_[0] = static_cast<score_t>(cnt_positive) / cnt_negative;
} else {
label_weights_[1] = static_cast<score_t>(cnt_negative) / cnt_positive;
label_weights_[0] = 1.0f;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment