Repository navigation
Conversation
jnothman
left a comment
There was a problem hiding this comment.
Looks nice
Please add an entry to the change log at doc/whats_new/v0.21.rst. Like the other entries there, please reference this pull request with :issue: and credit yourself (and other contributors if applicable) with :user:
|
|
||
| boost = AdaBoostRegressor(DummyEstimator(), n_estimators=3) | ||
| boost.fit(X, y_regr) | ||
| assert_equal(len(boost.estimator_weights_), len(boost.estimator_errors_)) |
There was a problem hiding this comment.
With the adoption of pytest, we are phasing out use of test helpers assert_equal, assert_true, etc. Please use bare assert statements, e.g. assert x == y, assert not x, etc.
There was a problem hiding this comment.
I did not touch that test. It seems that I did because I removed and then readd the test_sparse_classification and test_sparse_regression tests. Do you want me to fix that even it is unrelated to the PR?
|
@jnothman @NicolasHug do you think that we should retain the |
jnothman
left a comment
There was a problem hiding this comment.
I don't understand. Why should we not retain those tests?
@jnothman in the process of the minimization of the validation I was thinking that these checks/tests should be in the responsibility of the base estimator. That's why I am asking. |
88cebc6 to
2e9a045
Compare
|
@jnothman |
| :issue:`6463` by :user:`movelikeriver <movelikeriver>`. | ||
|
|
||
| - |Enhancement| Minimized the validation of X in :class:`ensemble.AdaBoostClassifier` | ||
| and :class:`ensemble.AdaBoostRegressor` :issue:`13174` by :user:`Christos Aridas <chkoar>`. |
There was a problem hiding this comment.
please keep lines under 80 characters
|
|
||
| def _validate_data(self, X, y=None): | ||
|
|
||
| accept_sparse = ['csr', 'csc'] |
There was a problem hiding this comment.
It took me a while to understand why we don't just accept_sparse=True. Maybe add a comment that these are required for safe_indexing support???
There was a problem hiding this comment.
test_sparse_regression and test_sparse_classification check that sparse matrices will be converted in one of the two formats. Check here for instance. We could minimize more the validation by turn of these assertions and use accept_sparse=True but safe_indexing does not support all sparse matrices. What do you propose?
There was a problem hiding this comment.
What @jnothman is asking for is simply a comment on the line above saying that these are required for safe_indexing support.
GaelVaroquaux
left a comment
There was a problem hiding this comment.
LGTM, but the comment by @jnothman should be addressed (it's just a question of adding a comment line)
|
|
||
| def _validate_data(self, X, y=None): | ||
|
|
||
| accept_sparse = ['csr', 'csc'] |
There was a problem hiding this comment.
What @jnothman is asking for is simply a comment on the line above saying that these are required for safe_indexing support.
|
Some PEP8 I think |
|
@glemaitre good catch. I think it is ok. |
|
Thanks @chkoar! |
)" This reverts commit cc6fbf4.
)" This reverts commit cc6fbf4.
… base estimator Pin 09bc27630fb8feea2f10627dce25e93cd6ff258a and its regression selectors for reproducible runs. Source: scikit-learn/scikit-learn#13174
Reference Issues/PRs
Fixes #7768. Takes over #8304.
What does this implement/fix? Explain your changes.
This PR (almost) transfers the responsibility of the validation of
Xandyfrom AdaBoost to the base estimator.Any other comments?
I retained all the tests. If we want to relax the check about sparsity we should remove the
test_sparse_classificationandtest_sparse_regressiontests.