API add verbose flag for Voting* estimators - #15991
Conversation
…ssor addresses issue #10360
|
@jnothman @NicolasHug cc: @cmarmo |
|
@reshamas , I've tried to review this PR but it turns out there are a lot of things to change and I don't think I'm capable to guide you in making those changes... maybe the issue is less "Easy" than it was supposed to be... :) |
|
@cmarmo |
…ers to `_parallel_fit_estimator`.
Fix test errors for PR #15991
|
Oh my... :( ... sorry @reshamas ... lint error... Could you take care of that? Thanks! |
|
@thomasjpfan , this PR heavily relies on your example (#11364). Could you take a look, please? |
| @@ -64,8 +64,12 @@ def fit(self, X, y, sample_weight=None): | |||
|
|
|||
| self.estimators_ = Parallel(n_jobs=self.n_jobs)( | |||
| delayed(_parallel_fit_estimator)(clone(clf), X, y, | |||
There was a problem hiding this comment.
Could you put clone(clf), .... on the next line. It will give you some space to call self._log_message() on the same line).
| check_is_fitted(self) | ||
| return self._predict(X) | ||
|
|
||
| def _log_message(self, name, idx, total): |
There was a problem hiding this comment.
Since the function is called in both Voting* estimator, we could move it in _BaseVoting avoiding to have repeated code in both Voting* classes?
| check_no_attributes_set_in_init(estimator.__class__.__name__, estimator) | ||
|
|
||
|
|
||
| def test_voting_verbose_vc(capsys): |
There was a problem hiding this comment.
Since the 2 tests are really similar, I would advise making them general enough such that we can parametrize the test with a VotingClassifier and a VotingRegressor.
| - |Enhancement| improve error message in :func:`utils.validation.column_or_1d`. | ||
| :pr:`15926` by :user:`Loïc Estève <lesteve>`. | ||
|
|
||
| Multiple modules |
There was a problem hiding this comment.
These are only in sklearn.ensemble
verbose flag for VotingClassifier and VotingRegressorCo-Authored-By: Guillaume Lemaitre <[email protected]>
Co-Authored-By: Guillaume Lemaitre <[email protected]>
Co-Authored-By: Guillaume Lemaitre <[email protected]>
|
Closed by #16069 |
Reference Issues/PRs
References #11364
Closes #14772
What does this implement/fix? Explain your changes.
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.
Any other comments?
Continuing work begun by @hannahbrucemacdonald and @spbail at NYC sprint (Aug 2019)