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

early stopping always puts objective as stopping metric, when monitoring several metrics and setting first_metric_only=True #6223

Open
jc-numeus opened this issue Dec 3, 2023 · 1 comment
Labels

Comments

@jc-numeus
Copy link

Description

when i include the objective function in the metric parameter list besides other metrics, even if i put another metric such as pearson at the beginning of the list, and also at the beginning at feval (which i think correctly makes it the 'first metric'), when i use first metric only = True, the early stopping always switches to stopping based on my objective function. i debugged this down to a breakpoint in the early stopping callback python implementation, this line:
self.first_metric = env.evaluation_result_list[0][1].split(" ")[-1]
here, it seems that evaluation_result_list is somehow being resorted before, such that the first metric is the objective, even though i want to stop based on for instance pearson correlation.

Reproducible example

...

Environment info

LightGBM version or commit hash: 4.1

Command(s) you used to install LightGBM

Additional Comments

@jmoralez
Copy link
Collaborator

jmoralez commented Dec 4, 2023

Hey @jc-numeus, thanks for using LightGBM. Can you please provide a reproducible example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants