Last active
August 5, 2020 06:44
-
-
Save jrzaurin/650b2487416716af8a8c428604aa519f to your computer and use it in GitHub Desktop.
How to use custom loss for training lightgbm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
focal_loss = lambda x,y: focal_loss_lgb(x, y, alpha=0.25, gamma=1.) | |
focal_loss_eval = lambda x,y: focal_loss_lgb_eval_error(x, y, alpha=0.25, gamma=1.) | |
model = lgb.train(best, self.lgtrain, fobj=focal_loss, feval=focal_loss_eval) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment