Guest User

Untitled

a guest
Oct 23rd, 2019
83
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