Skip to content

[MRG + 1] Fix sklearn.model_selection.tests.test_split:test_cv_iterable_wrapper on numpy master #7946

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 1 commit into from
Nov 29, 2016

Conversation

lesteve
Copy link
Member

@lesteve lesteve commented Nov 27, 2016

As mentioned in #7910 (comment) the tests started failing with numpy master one day or so ago.

What does this implement/fix? Explain your changes.

It looks like we were in a edge case of assert_array_equal. See numpy/numpy#8323 (comment) for more details.

I am using numpy.testing.assert_equal which seems better at dealing with nested structures containing arrays.

Until now we were in a edge case on assert_array_equal
splits_are_equal = True
except AssertionError:
splits_are_equal = False
assert_false(splits_are_equal, "If the splits are randomized, "
Copy link
Member Author

@lesteve lesteve Nov 27, 2016

Choose a reason for hiding this comment

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

I am afraid I did not find a better way of emulating numpy.testing.assert_not_equal. Better suggestions welcome!

Copy link
Member

Choose a reason for hiding this comment

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

@raghavrv just reimplemented that in #7935 where I suggested

assert_false(all([(x == y).all() for x, y in zip(cvs[1].split(*data), cv[2].split(*data))]))

which is also not the prettiest solution.

Copy link
Member

Choose a reason for hiding this comment

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

we could also implement our own version of that?

@lesteve lesteve changed the title [MRG] Fix sklearn.model_selection.tests.test_split tests on numpy master [MRG] Fix sklearn.model_selection.tests.test_split:test_cv_iterable_wrapper on numpy master Nov 27, 2016
@jnothman
Copy link
Member

Is this related to #7823

@amueller
Copy link
Member

LGTM as quick fix.

@amueller amueller changed the title [MRG] Fix sklearn.model_selection.tests.test_split:test_cv_iterable_wrapper on numpy master [MRG + 1] Fix sklearn.model_selection.tests.test_split:test_cv_iterable_wrapper on numpy master Nov 29, 2016
@raghavrv
Copy link
Member

LGTM as well. Feel free to merge!

@raghavrv
Copy link
Member

I can refactor this out of #7823...

@raghavrv raghavrv merged commit 34968d4 into scikit-learn:master Nov 29, 2016
@raghavrv
Copy link
Member

Thx @lesteve

@lesteve lesteve deleted the fix-test-on-numpy-master branch November 30, 2016 07:21
sergeyf pushed a commit to sergeyf/scikit-learn that referenced this pull request Feb 28, 2017
Until now we were in a edge case on assert_array_equal
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
Until now we were in a edge case on assert_array_equal
jakirkham pushed a commit to jakirkham/scikit-learn that referenced this pull request Jun 15, 2017
Until now we were in a edge case on assert_array_equal
amueller pushed a commit that referenced this pull request Jun 19, 2017
* Fix tests on numpy master (#7946)

Until now we were in a edge case on assert_array_equal

* Fix tests on numpy master (#8355)

numpy.apply_along_axis has changed behaviour when the function passed
in returns a 2d array

* [MRG] Updated plot_stock_market.py to use Google Finance (#9010)

* DOC updated plot_stock_market.py to use Google Finance

The implementations is intentionally very basic not to distract the users
from the example. Specifically unlike ``quotes_historical_yahoo_ochl`` it
does not cache downloaded data.

I also had to remove some symbols because the have no data on Google for
the specified date interval. These are WBA, LMT, KFT and MTU.

Closes #8899

* DOC removed plot_stock_market.py from expected failing examples

* Addressed review comments

* Addressed another pass of review comments

* [MRG] Remove DeprecationWarnings in examples due to using floats instead of ints (#8040)
NelleV pushed a commit to NelleV/scikit-learn that referenced this pull request Aug 11, 2017
Until now we were in a edge case on assert_array_equal
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
Until now we were in a edge case on assert_array_equal
maskani-moh pushed a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017
Until now we were in a edge case on assert_array_equal
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.

4 participants