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

Fix application of best_ntree_limit to the entire list of estimators. Instead the limit is applied to per-class estimators split #83

Merged
merged 3 commits into from
Apr 3, 2019

Conversation

izeigerman
Copy link
Member

No description provided.

… Instead the limit is applied to per-class estimators split
@izeigerman izeigerman requested a review from krinart April 2, 2019 23:55
@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 95.055% when pulling 8311869 on iaroslav/fix_xgboost_best_ntree_limit into 8610a18 on master.

@coveralls
Copy link

coveralls commented Apr 3, 2019

Coverage Status

Coverage increased (+0.01%) to 95.06% when pulling 9cea6df on iaroslav/fix_xgboost_best_ntree_limit into 8610a18 on master.

@@ -34,6 +36,10 @@ def assemble(self):
self.all_trees, self._base_score)

def _assemble_single_output(self, trees, base_score=0):
if self._tree_limit is not None:
assert self._tree_limit > 0, "Unexpected tree limit"
Copy link
Member

Choose a reason for hiding this comment

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

I think __init__ method would be better place for this assert:

  • No need to perform it every time this function runs
  • It would raise an error right when we pass it, not when we use it later

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@krinart krinart merged commit d6ec7ec into master Apr 3, 2019
@izeigerman izeigerman deleted the iaroslav/fix_xgboost_best_ntree_limit branch April 3, 2019 18:36
@izeigerman izeigerman restored the iaroslav/fix_xgboost_best_ntree_limit branch May 15, 2019 17:09
@izeigerman izeigerman deleted the iaroslav/fix_xgboost_best_ntree_limit branch May 15, 2019 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants