f1_score metric in lightgbm
问题 I want to train a lgb model with custom metric : f1_score with weighted average. I went through the advanced examples of lightgbm over here and found the implimentation of custom binary error function. I implemented as similiar functon to return f1_score as shown below. def f1_metric(preds, train_data): labels = train_data.get_label() return 'f1', f1_score(labels, preds, average='weighted'), True I tried to train the model by passing feval parameter as f1_metric as shown below. evals_results