We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The private HalfBinomialLoss gradient and hessian returns np.NaN for large negative values of raw_prediction:
HalfBinomialLoss
np.NaN
raw_prediction
gradient
gradient_hessian
loss_gradient
import numpy as np from sklearn._loss import HalfBinomialLoss loss = HalfBinomialLoss() y_true, raw = np.array([1.]), np.array([-1e3]) [ loss.gradient(y_true, raw), loss.loss_gradient(y_true, raw), loss.gradient_hessian(y_true, raw), ]
gradient = -1 and hessian = 0
[array([nan]), (array([1000.]), array([-1.])), (array([nan]), array([nan]))]
sklearn: 1.3.2
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
The private
HalfBinomialLoss
gradient and hessian returnsnp.NaN
for large negative values ofraw_prediction
:gradient
gradient_hessian
Only the
loss_gradient
returns the correct gradient.Steps/Code to Reproduce
Expected Results
gradient = -1 and hessian = 0
Actual Results
Versions
The text was updated successfully, but these errors were encountered: