Commit f3b1daf8 authored by Guolin Ke's avatar Guolin Ke
Browse files

Merge branch 'master' into dev

parents dd5f2b27 0241d323
...@@ -47,8 +47,13 @@ public: ...@@ -47,8 +47,13 @@ public:
label_weights_[1] = 1.0f; label_weights_[1] = 1.0f;
// if using unbalance, change the labels weight // if using unbalance, change the labels weight
if (is_unbalance_) { if (is_unbalance_) {
label_weights_[1] = 1.0f; if (cnt_positive > cnt_negative) {
label_weights_[0] = static_cast<score_t>(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