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

Skip to content

[MRG] Verbose flag for VotingClassifier and VotingRegressor - #14772

Closed
hannahbrucemacdonald wants to merge 10 commits into
scikit-learn:masterfrom
hannahbrucemacdonald:verbose-vc
Closed

[MRG] Verbose flag for VotingClassifier and VotingRegressor#14772
hannahbrucemacdonald wants to merge 10 commits into
scikit-learn:masterfrom
hannahbrucemacdonald:verbose-vc

Conversation

@hannahbrucemacdonald

@hannahbrucemacdonald hannahbrucemacdonald commented Aug 24, 2019

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

@amueller I think this is ready for review!

@NicolasHug NicolasHug 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 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
Copy Markdown
Member

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

@spbail

spbail commented Sep 5, 2019 via email

Copy link
Copy Markdown

@hannahbrucemacdonald

Copy link
Copy Markdown
Contributor Author

Hey!

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

@spbail

spbail commented Sep 5, 2019 via email

Copy link
Copy Markdown

@kellycarmody

kellycarmody commented Sep 18, 2019

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

@reshamas

Copy link
Copy Markdown
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
Copy Markdown
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