Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MRG] Verbose flag for VotingClassifier and VotingRegressor #14772

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

Closed

Conversation

hannahbrucemacdonald
Copy link
Contributor

@hannahbrucemacdonald hannahbrucemacdonald commented Aug 24, 2019

@spbail

This PR adds a boolean verbose flag for the classes in voting.py. Adds function _log_message to _BaseVoting and uses code format as in #11364.

Verbose messages looks like:

[Voting] ............ (classifier 1 of 3) Processing lr, total= 0.0s
[Voting] ............ (classifier 2 of 3) Processing rf, total= 0.0s
[Voting] ........... (classifier 3 of 3) Processing gnb, total= 0.0s

@amueller
Copy link
Member

as I think you realized, this is still WIP because you need a test ;)

@hannahbrucemacdonald hannahbrucemacdonald changed the title [MRG] Verbose flag for VotingClassifier and VotingRegressor [WIP] Verbose flag for VotingClassifier and VotingRegressor Aug 24, 2019
@hannahbrucemacdonald
Copy link
Contributor Author

Adding a test before MRG

@hannahbrucemacdonald hannahbrucemacdonald changed the title [WIP] Verbose flag for VotingClassifier and VotingRegressor [MRG] Verbose flag for VotingClassifier and VotingRegressor Aug 24, 2019
@hannahbrucemacdonald
Copy link
Contributor Author

@amueller I think this is ready for review!

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @hannahbrucemacdonald !

This looks good overall, I think we could use a few more tests, in particular for the VotingRegressor class

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

@NicolasHug
Copy link
Member

Friendly ping @hannahbrucemacdonald , could you please address the comments? Thanks!

@spbail
Copy link

spbail commented Sep 5, 2019 via email

@hannahbrucemacdonald
Copy link
Contributor Author

Hey!

Sorry I can finish this up over the weekend, unless you want to do it @spbail

@spbail
Copy link

spbail commented Sep 5, 2019 via email

@kellycarmody
Copy link
Contributor

kellycarmody commented Sep 18, 2019

Hi @hannahbrucemacdonald and @spbail, we're trying to get all the PR's from the sprint finished up soon, would it be possible to wrap this one up? Thanks very much!

@hannahbrucemacdonald
Copy link
Contributor Author

Sorry I'm on holiday and won't have time until October, sorry for not getting to it sooner!

@reshamas
Copy link
Member

@NicolasHug can you provide more guidance on what other tests should be added?

@spbail Will you be continuing work on this PR?

cc: @cmarmo (This PR is from the NYC wimlds sprint, Aug 2019.)

r'\[Voting\].*\(classifier 3 of 3\)'
' Processing gnb, total=.*\n$'])
def test_voting_verbose(pattern, capsys):
clf1 = LogisticRegression(random_state=123)
Copy link
Member

Choose a reason for hiding this comment

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

Instead use:

@pytest.mark.parametrize('est', [
    VotingClassifier([('lr', LogisticRegression(random_state=123)), ('rf', RandomForestClassifier(random_state=123))]),
])

and then it's easy to also test for VotingRegressor

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.

7 participants