Skip to content

[MRG] _get_estimators_indices() in BaseBagging class does not generate indices properly#16437

Merged
rth merged 14 commits into
scikit-learn:masterfrom
chofchof:issue_16436
Feb 20, 2020
Merged

[MRG] _get_estimators_indices() in BaseBagging class does not generate indices properly#16437
rth merged 14 commits into
scikit-learn:masterfrom
chofchof:issue_16436

Conversation

@chofchof

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Fixes #16436.

What does this implement/fix? Explain your changes.

It solves the bug reported by the issue #16436, _get_estimators_indices() in BaseBagging class does not generate indices properly.

As Joel Nothman suggested, the seed is passed directly into _generate_bagging_indices() instead of the numpy RandomState object generated by the seed.

Any other comments?

None.

@jnothman

Copy link
Copy Markdown
Member

Thanks for the pull request!
Tests are failing. And you'll need to add a new one to test this issue.
Thanks for the pull request! Please make the title of the PR more descriptive. The title will become the commit message when this is merged. You should state what issue (or PR) it fixes/resolves in the description using the syntax described here.

@glemaitre glemaitre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As a regression test, you can use the one that you reported in the issue. This is good.

Comment thread sklearn/ensemble/_bagging.py Outdated
Comment thread sklearn/ensemble/_bagging.py Outdated
@glemaitre

Copy link
Copy Markdown
Member

I am wondering if we have something similar regarding the feature indices?

@glemaitre

Copy link
Copy Markdown
Member

Regarding the failing tests, this is due to the change of the score in one of the docstring. This should be corrected as well.

@chofchof chofchof changed the title Pull requests for Issues #16436 [WIP] _get_estimators_indices() in BaseBagging class does not generate indices properly Feb 14, 2020
@chofchof chofchof closed this Feb 14, 2020
@chofchof

Copy link
Copy Markdown
Contributor Author

I am wondering if we have something similar regarding the feature indices?

No similar problem regarding the feature_indices. The method _get_estimators_indices() is used only in the property estimators_samples_, but this property takes sample_indices only.

@chofchof chofchof reopened this Feb 14, 2020
@chofchof chofchof changed the title [WIP] _get_estimators_indices() in BaseBagging class does not generate indices properly [MRG] _get_estimators_indices() in BaseBagging class does not generate indices properly Feb 14, 2020
@chofchof chofchof requested a review from glemaitre February 14, 2020 07:24

@glemaitre glemaitre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add an entry to the change log at doc/whats_new/v0.23.rst under bug fixes. Like the other entries there, please reference this pull request with :pr: and credit yourself (and other contributors if applicable) with :user:

I think that we change the behaviour of ExtraTrees* as well, so we should add a note in the what's new on the top (change in behaviour section)

Comment thread sklearn/ensemble/tests/test_bagging.py
Comment thread sklearn/ensemble/tests/test_bagging.py Outdated
Comment thread sklearn/ensemble/tests/test_bagging.py
Comment thread sklearn/ensemble/tests/test_bagging.py Outdated
Comment thread sklearn/ensemble/tests/test_bagging.py Outdated
@chofchof

chofchof commented Feb 17, 2020

Copy link
Copy Markdown
Contributor Author

Please add an entry to the change log at doc/whats_new/v0.23.rst under bug fixes. Like the other entries there, please reference this pull request with :pr: and credit yourself (and other contributors if applicable) with :user:

Added an entry to the change log as you suggested. Thanks a lot.
May I add your name as a contributor?

I think that we change the behaviour of ExtraTrees* as well, so we should add a note in the what's new on the top (change in behaviour section)

I have no idea on this one. Do I have to do something more?

@chofchof chofchof requested a review from glemaitre February 17, 2020 04:40
Comment thread doc/whats_new/v0.23.rst Outdated
Comment thread doc/whats_new/v0.23.rst
@glemaitre

Copy link
Copy Markdown
Member

May I add your name as a contributor?

No need for this

@glemaitre glemaitre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Apart from correcting the what's new entry, everything looks good.
We will need a second review.

@jnothman Could you have a look at this one?

Comment thread doc/whats_new/v0.23.rst Outdated
Comment thread sklearn/ensemble/tests/test_bagging.py Outdated
@chofchof chofchof requested a review from jnothman February 19, 2020 02:46
@glemaitre

Copy link
Copy Markdown
Member

I push a quick reformatting of the what's new to follow the 80 characters limit.
@jnothman I think it looks good now.

@rth rth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @chofchof ! LGTM.

@rth rth merged commit baa4f07 into scikit-learn:master Feb 20, 2020
thomasjpfan pushed a commit to thomasjpfan/scikit-learn that referenced this pull request Feb 22, 2020
panpiort8 pushed a commit to panpiort8/scikit-learn that referenced this pull request Mar 3, 2020
gio8tisu pushed a commit to gio8tisu/scikit-learn that referenced this pull request May 15, 2020
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.

_get_estimators_indices() in BaseBagging class does not generate indices properly

4 participants