SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def focal_loss_lgb_f1_score(preds, lgbDataset):
  2.   preds = sigmoid(preds)
  3.   binary_preds = [int(p>0.5) for p in preds]
  4.   y_true = lgbDataset.get_label()
  5.   return 'f1', f1_score(y_true, binary_preds), True
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top