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

fix unbalance for binary classification

parent 47313fb5
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -47,8 +47,8 @@ public:
label_weights_[1] = 1.0f;
// if using unbalance, change the labels weight
if (is_unbalance_) {
label_weights_[1] = 1.0f / cnt_positive;
label_weights_[0] = 1.0f / cnt_negative;
label_weights_[1] = 1.0f;
label_weights_[0] = static_cast<float>(cnt_positive) / cnt_negative;
}
}
......
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