I'm using lightgbm.train with valid_sets, early_stopping_rounds and feval function for multiclass problem with "objective": "multiclass". I want to find best_iteration and best_score for my custom evaluation function. But it finds them for multi_logloss metrics, which is corresponding to specified objective. So the question is can I find in LightGBM best_iteration and best_score for my feval function and how?
Asked
Active
Viewed 810 times
0
-
1Please provide some code and read [this section](https://stackoverflow.com/help/mcve). – Cleb Apr 20 '18 at 14:17
2 Answers
0
This happens due to the fact that the objective function is included in the list of evaluation metrics by default. Early stopping in LightGBM happens based on any included metric. See a short summary and a link to another issue with a longer discussion in this LightGBM issue.

Mischa Lisovyi
- 3,207
- 18
- 29
0
You can use objective:"multi_error"
, or also you can combine objectives as
objective: "multi_error", "multi_logloss"
Multi_error will directly focus on the accuracy.

Patrick Haugh
- 59,226
- 13
- 88
- 96

Ugur MULUK
- 446
- 2
- 8