-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG+1] TST Improve SelectFromModel tests #9733
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Should fix one of the issues in scikit-learn#9393
Btw, this avoids the issue in #9393 by comparing masks (a weaker assertion) rather than the importances of the wrapped estimator, which are susceptible to being affected by weight scale. |
LGTM, Could you reproduce the problem you pasted in #9393 (comment) and do you have an idea whether this PR gets rid of it. Copy and paste of the failure for good measure:
|
No, I've not reproduced that bug, but seeing as it was numerical
imprecision among the coefficients, as long as there are no near-equal
coefficients around the threshold, this should resolve it...
…On 19 September 2017 at 21:58, Loïc Estève ***@***.***> wrote:
LGTM, Could you reproduce the problem you pasted in #9393 (comment)
<#9393 (comment)>
and do you have an idea whether this PR gets rid of it.
Copy and paste of the error for good measure:
======================================================================
FAIL: sklearn.feature_selection.tests.test_from_model.test_feature_importances
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/<<PKGBUILDDIR>>/debian/tmp/usr/lib/python2.7/dist-packages/sklearn/utils/testing.py", line 667, in run_test
return func(*args, **kwargs)
File "/<<PKGBUILDDIR>>/debian/tmp/usr/lib/python2.7/dist-packages/sklearn/feature_selection/tests/test_from_model.py", line 72, in test_feature_importances
assert_almost_equal(importances, importances_bis, decimal=4)
File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 573, in assert_almost_equal
return assert_array_almost_equal(actual, desired, decimal, err_msg)
File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 979, in assert_array_almost_equal
precision=decimal)
File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 796, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not almost equal to 4 decimals
(mismatch 70.0%)
x: array([ 0.1537, 0.2294, 0.1825, 0.0667, 0.0485, 0.0587, 0.0643,
0.0642, 0.066 , 0.066 ])
y: array([ 0.1527, 0.2294, 0.1822, 0.0675, 0.0483, 0.0587, 0.0648,
0.0642, 0.0656, 0.0665])
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9733 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz6yeIYWDidv7bOW9gVUo919mN3IVNks5sj6xPgaJpZM4PT8Xr>
.
|
LGTM as well. |
ogrisel
pushed a commit
that referenced
this pull request
Sep 20, 2017
Should fix one of the issues in #9393
Cherry-picked to 0.19.X as a552a13. |
I've been avoiding cherry-picking, so that we can see all that is being
pulled across to 0.19.X in
#9607
…On 21 September 2017 at 01:35, Olivier Grisel ***@***.***> wrote:
Cherry-picked to 0.19.X as a552a13
<a552a13>
.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9733 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz678XVueNiV9LA5E1nbVEHUyre5SBks5skTDPgaJpZM4PT8Xr>
.
|
amueller
pushed a commit
that referenced
this pull request
Oct 21, 2017
Should fix one of the issues in #9393
yarikoptic
added a commit
to yarikoptic/scikit-learn
that referenced
this pull request
Oct 24, 2017
* tag '0.19.1': (117 commits) TST Improve SelectFromModel tests (scikit-learn#9733) Name in what's new [MRG+1] Raise error when SparseSeries is passed into classification metrics (scikit-learn#7373) Fix LogisticRegressionCV default solver value in docstring (scikit-learn#9962) [MRG+1] DOC fix sign in GBRT mathematical formulation (scikit-learn#9885) [MRG+1] DOC fix sign in GBRT mathematical formulation (scikit-learn#9885) DOC fix a typo (scikit-learn#9892) [MRG+1] Ledoit-Wolf behavior explanation (scikit-learn#9500) [MRG+1] Fix typos in documentation (scikit-learn#9878) DOC: Use setattr(self, ...) instead of self.setattr(...) (scikit-learn#9866) DOC Removed a duplicate occurrence of a word in 'sklearn.neighbors.KNeighborsRegressor' docs (scikit-learn#9862) FIX docstring of negative_outlier_factor_ in LOF (scikit-learn#9809) [MRG+1] Fix scikit-learn#9743: Adding parameter information to docstring. (scikit-learn#9757) DOC: fix docstring of Imputer.fit (scikit-learn#9769) various minor spelling tweaks (scikit-learn#9783) MAINT comment on apparent inconsistency [MRG+1] DOC fix headers level in cross_validation.rst (scikit-learn#9679) Fix mailmap format (scikit-learn#9620) DOC Fix typos (scikit-learn#9577) Typo (scikit-learn#9571) ...
yarikoptic
added a commit
to yarikoptic/scikit-learn
that referenced
this pull request
Oct 24, 2017
* releases: (117 commits) TST Improve SelectFromModel tests (scikit-learn#9733) Name in what's new [MRG+1] Raise error when SparseSeries is passed into classification metrics (scikit-learn#7373) Fix LogisticRegressionCV default solver value in docstring (scikit-learn#9962) [MRG+1] DOC fix sign in GBRT mathematical formulation (scikit-learn#9885) [MRG+1] DOC fix sign in GBRT mathematical formulation (scikit-learn#9885) DOC fix a typo (scikit-learn#9892) [MRG+1] Ledoit-Wolf behavior explanation (scikit-learn#9500) [MRG+1] Fix typos in documentation (scikit-learn#9878) DOC: Use setattr(self, ...) instead of self.setattr(...) (scikit-learn#9866) DOC Removed a duplicate occurrence of a word in 'sklearn.neighbors.KNeighborsRegressor' docs (scikit-learn#9862) FIX docstring of negative_outlier_factor_ in LOF (scikit-learn#9809) [MRG+1] Fix scikit-learn#9743: Adding parameter information to docstring. (scikit-learn#9757) DOC: fix docstring of Imputer.fit (scikit-learn#9769) various minor spelling tweaks (scikit-learn#9783) MAINT comment on apparent inconsistency [MRG+1] DOC fix headers level in cross_validation.rst (scikit-learn#9679) Fix mailmap format (scikit-learn#9620) DOC Fix typos (scikit-learn#9577) Typo (scikit-learn#9571) ...
yarikoptic
added a commit
to yarikoptic/scikit-learn
that referenced
this pull request
Oct 24, 2017
* dfsg: (117 commits) TST Improve SelectFromModel tests (scikit-learn#9733) Name in what's new [MRG+1] Raise error when SparseSeries is passed into classification metrics (scikit-learn#7373) Fix LogisticRegressionCV default solver value in docstring (scikit-learn#9962) [MRG+1] DOC fix sign in GBRT mathematical formulation (scikit-learn#9885) [MRG+1] DOC fix sign in GBRT mathematical formulation (scikit-learn#9885) DOC fix a typo (scikit-learn#9892) [MRG+1] Ledoit-Wolf behavior explanation (scikit-learn#9500) [MRG+1] Fix typos in documentation (scikit-learn#9878) DOC: Use setattr(self, ...) instead of self.setattr(...) (scikit-learn#9866) DOC Removed a duplicate occurrence of a word in 'sklearn.neighbors.KNeighborsRegressor' docs (scikit-learn#9862) FIX docstring of negative_outlier_factor_ in LOF (scikit-learn#9809) [MRG+1] Fix scikit-learn#9743: Adding parameter information to docstring. (scikit-learn#9757) DOC: fix docstring of Imputer.fit (scikit-learn#9769) various minor spelling tweaks (scikit-learn#9783) MAINT comment on apparent inconsistency [MRG+1] DOC fix headers level in cross_validation.rst (scikit-learn#9679) Fix mailmap format (scikit-learn#9620) DOC Fix typos (scikit-learn#9577) Typo (scikit-learn#9571) ...
maskani-moh
pushed a commit
to maskani-moh/scikit-learn
that referenced
this pull request
Nov 15, 2017
Should fix one of the issues in scikit-learn#9393
jwjohnson314
pushed a commit
to jwjohnson314/scikit-learn
that referenced
this pull request
Dec 18, 2017
Should fix one of the issues in scikit-learn#9393
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Should fix one of the issues in #9393
Also separates out some tests that were inappropriately stuck in one ill-named function.