-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
LightGBM - GBDT model earlystop bug fix #3614
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aaronrockmenezes Excited to see this! A quick reminder to make sure to add some additional unit tests to check this new functionality
@rbharath I had a doubt. The original code used early stopping by default. Wouldn't it be better if we kept it as an option? It would make the code a little longer, but seems fair. |
@rbharath Added test to keep early stopping greater than 1. |
if self.early_stopping_rounds<=0: | ||
raise ValueError("Early Stopping Rounds cannot be less than 1.") | ||
|
||
if self.model.__class__.__name__.startswith('XGB'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a unit test for callbacks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll do that
921f57e
to
253c94c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few changes needed:
- Fix mypy issues
- Add explicit unit tests
- Remove assert statements and instead raise exceptions instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to merge in once CI is clear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Fix for #3559
Added callbacks for early stopping for newer versions of LightGBM and XGBoost.
Type of change
Please check the option that is related to your PR.
Checklist
yapf -i <modified file>
and check no errors (yapf version must be 0.32.0)mypy -p deepchem
and check no errorsflake8 <modified file> --count
and check no errorspython -m doctest <modified file>
and check no errors