Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix for first_metric_only on earlystopping #2127

Closed

Conversation

matsuken92
Copy link
Contributor

  1. Order of metric list is not fixed even if it is defined by list. So explicitly indicating which metric is used on early stopping.
  2. Due to introducing eval_train_metric feature, if the feature is enabled, then the first metric became train score of the metrics, so it does not appropriate for early stopping. So until the specified metrics of validation is coming, skipping to check early stopping in the loop.

1. Order of `metric` is not fixed even if it is defined by list. So explicitly indicating which metric is used on early stopping.
2. Due to introducins `eval_train_metric` feature, then the first metric was train score og the metrics, so it doess not appropriate for early stopping.
@StrikerRUS
Copy link
Collaborator

StrikerRUS commented Apr 27, 2019

Hi @matsuken92 !
Can you please rebase the branch and fix failing test to start reviewing process? Thanks!

@StrikerRUS StrikerRUS mentioned this pull request Apr 30, 2019
@guolinke
Copy link
Collaborator

guolinke commented May 1, 2019

the tests failed. @matsuken92 @StrikerRUS any ideas?

@matsuken92
Copy link
Contributor Author

The failure case of the test is that metric is default metric (None, "None" , "" and so on.) I'm now considering how to handle this case, so please wait.

@guolinke
Copy link
Collaborator

guolinke commented May 17, 2019

@matsuken92

Due to introducing eval_train_metric feature, if the feature is enabled, then the first metric became train score of the metrics, so it does not appropriate for early stopping. So until the specified metrics of validation is coming, skipping to check early stopping in the loop.

I think the first_metric_only should be used for all validation data (including training set when eval_train_metric is set). That is, the first metrics of all validation data should be considered in early stopping, not only the first metric of first validation data.

refer to #2049 (comment)

@StrikerRUS
Copy link
Collaborator

@guolinke Sorry, but I'm confused a little bit. Why need it to check early stopping on training data?
Current behavior is opposite:

If there is more than one, it will use all of them except the training data:

@guolinke
Copy link
Collaborator

@StrikerRUS training data will not meet early stopping condition, as it will be always better.
Therefore, using training data together with validation data for early stopping is okay.

@StrikerRUS
Copy link
Collaborator

StrikerRUS commented May 17, 2019

@guolinke Then docs should be updated as well, right?
Refer to #1374 and #1393.
Or not?..

@guolinke
Copy link
Collaborator

@StrikerRUS we can keep them. although it actually checks the training metric...

@guolinke
Copy link
Collaborator

guolinke commented May 21, 2019

@matsuken92 any news ? the v2.2.4 release (#2138) is blocked by this PR.

@matsuken92
Copy link
Contributor Author

Really sorry for my late response.
I will investigate it and commit the bug fix result on this week end.

@matsuken92
Copy link
Contributor Author

matsuken92 commented Jun 1, 2019

Current status:

@guolinke
Copy link
Collaborator

guolinke commented Jun 1, 2019

@matsuken92
Thanks! for the branch issue, you can force update bugfix/first_metric_only with the code of bugfix/first_metric_only_train_metric

@matsuken92
Copy link
Contributor Author

@guolinke Thank you for your advice.
Now I fixed this issue on bugfix/first_metric_only_train_metric branch and add test items for them.
https://github.com/matsuken92/LightGBM/tree/bugfix/first_metric_only_train_metric
However, I still can not understand how to replace bugfix/first_metric_only_train_metric to bugfix/first_metric_only.
I would appreciate it if you would help me to replace them!

@StrikerRUS
Copy link
Collaborator

@matsuken92 Maybe you can create new PR for bugfix/first_metric_only_train_metric? I think it's the fastest and most painless way. This PR will be closed then.

@StrikerRUS
Copy link
Collaborator

Superseded by #2209.

@StrikerRUS StrikerRUS closed this Sep 15, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants