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

Add tolerance to early stopping. #6942

Merged
merged 4 commits into from
May 13, 2021
Merged

Conversation

trivialfis
Copy link
Member

Close #4982 .

@codecov-commenter
Copy link

codecov-commenter commented May 11, 2021

Codecov Report

Merging #6942 (8f09468) into master (2a9979e) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6942      +/-   ##
==========================================
+ Coverage   82.01%   82.06%   +0.05%     
==========================================
  Files          13       13              
  Lines        3908     3914       +6     
==========================================
+ Hits         3205     3212       +7     
+ Misses        703      702       -1     
Impacted Files Coverage Δ
python-package/xgboost/callback.py 82.35% <100.00%> (+0.49%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a9979e...8f09468. Read the comment docs.

"""
def __init__(self,
rounds: int,
metric_name: Optional[str] = None,
data_name: Optional[str] = None,
maximize: Optional[bool] = None,
save_best: Optional[bool] = False) -> None:
save_best: Optional[bool] = False,
tolerance: float = 0) -> None:
self.data = data_name
Copy link
Member

Choose a reason for hiding this comment

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

Might be worth specifying if it's absolute or relative or even providing both to be consistent with numpy etc.

Copy link
Member Author

@trivialfis trivialfis May 13, 2021

Choose a reason for hiding this comment

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

Changed the name to abs_tol with documents. I don't think relative tolerance is applicable here.

@candalfigomoro
Copy link

Can this also be added to XGBoost4J and XGBoost4J-Spark?

@trivialfis
Copy link
Member Author

@candalfigomoro I'm not sure, @wbo4958 has some interest in better es support in JVM packages, but that will depend on his priority.

@MJimitater
Copy link

Great work! Is this also added in XGBoost on R Cran?

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

Successfully merging this pull request may close these issues.

Customizable early stopping tolerance
5 participants