Closed tks0123456789 closed 8 years ago
Thanks, you are right, have fixed.
This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.
Gradients https://github.com/Microsoft/LightGBM/blob/master/src/objective/binary_objective.hpp#L63-L78 63 const scoret response = -2.0f * label * sigmoid / (1.0f + std::exp(2.0f * label * sigmoid_ * score[i])); 66 hessians[i] = absresponse * (2.0f * sigmoid - abs_response) * label_weight; and line 75, 78 This is derived from logloss func L = -log(1+exp(-2 * label * score)) and prob = 1 / (1+exp(-2score)). But the following prob calcs don't contain 2 \ within exp().
Probability https://github.com/Microsoft/LightGBM/blob/master/src/boosting/gbdt.cpp#L368 368 ret = 1.0 / (1.0 + std::exp(-sigmoid_ * ret));
https://github.com/Microsoft/LightGBM/blob/master/src/metric/binary_metric.hpp#L60-L68 60, 68 scoret prob = 1.0f / (1.0f + std::exp(-sigmoid * score[i]));
So you have two options. you can remove all 2.0f * in Gradients calculation, or you can add 2.0f* within exp() in probability calc.