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

[python] disabled early stopping in dart mode #1895

Merged
merged 2 commits into from
Dec 10, 2018
Merged

[python] disabled early stopping in dart mode #1895

merged 2 commits into from
Dec 10, 2018

Conversation

StrikerRUS
Copy link
Collaborator

@StrikerRUS StrikerRUS commented Dec 6, 2018

Refer to #1893 (comment).

Maybe error is better, because users tend to completely ignore warnings?

@guolinke
Copy link
Collaborator

guolinke commented Dec 6, 2018

@StrikerRUS I think we can disable early_stoping when using dart, even when early_stopping is set.

@StrikerRUS
Copy link
Collaborator Author

@guolinke At cpp side?

@guolinke
Copy link
Collaborator

guolinke commented Dec 6, 2018

@StrikerRUS the change of cpp side is in another PR.
The logic of early stopping is independent in cpp/python/R, so we need to disable it in python side as well.

@StrikerRUS
Copy link
Collaborator Author

@guolinke Ah, I see!

@StrikerRUS
Copy link
Collaborator Author

@guolinke I've updated PR. Unfortunately, I'm not familiar with callback module yet, therefore this solution might be ugly. Please check.

@StrikerRUS StrikerRUS changed the title [python] added warning for early stopping in dart mode [python] disabled early stopping in dart mode Dec 6, 2018
enabled = not any((boost_alias in env.params
and env.params[boost_alias] == 'dart') for boost_alias in ('boosting',
'boosting_type',
'boost'))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this can be moved into _init(env) ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guolinke Sorry, I was in a hurry and mislooked this aspect, which made me think that it's impossible to set enabled variable in _init function. I've reworked this.

@Teeeto
Copy link

Teeeto commented Nov 11, 2019

Sometimes early stopping is needed, disabling it may render dart mode quite useless. I'd suggest to save/override the best model (or at least a mask for dropped trees) in memory at each iteration and return the proper model when the early stopping is triggered.

@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants