Skip to content
New issue

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

Constrained Recall Objective has weird interaction with LightGBM early stopping criteria #11

Open
AndreFCruz opened this issue May 10, 2022 · 0 comments
Labels
bug Something isn't working low priority Nice to have but not crucial S effort T-shirt effort weighing: S

Comments

@AndreFCruz
Copy link
Contributor

Description

  • When optimizing for Recall (minimizing FNR), only label positive samples are considered for computing the loss or its gradient;
  • However, passing a gradient of zero for all label negatives leads to weird behavior in the GBM::Train function;
  • So, for now, we're scaling down the gradient of all label negatives by multiplying them with a tiny positive number: see the label_negative_weight in ConstrainedRecallObjective::GetGradients;
    • This shouldn't be needed, but seems to temporarily fix the issue with no unintended consequences (as the gradient flowing is very small);

Reproducible example

  1. Omit the else clause in ConstrainedRecallObjective::GetGradients, which deals with label negative samples, and in theory should not be needed for optimizing for recall;
  2. Compile and run, and observe weird "-inf split" messages, which can lead to training stopping too early;
@AndreFCruz AndreFCruz added the bug Something isn't working label Jul 4, 2022
@AndreFCruz AndreFCruz added low priority Nice to have but not crucial S effort T-shirt effort weighing: S labels Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority Nice to have but not crucial S effort T-shirt effort weighing: S
Projects
None yet
Development

No branches or pull requests

1 participant