Skip to content

[MRG+1] TST Stronger test for _check_is_permutation#7395

Merged
amueller merged 2 commits intoscikit-learn:masterfrom
raghavrv:model_selection_enhancements2
Sep 12, 2016
Merged

[MRG+1] TST Stronger test for _check_is_permutation#7395
amueller merged 2 commits intoscikit-learn:masterfrom
raghavrv:model_selection_enhancements2

Conversation

@raghavrv
Copy link
Copy Markdown
Member

Addresses one of the issues of #5053

@vene I think this should address your comment.

@raghavrv
Copy link
Copy Markdown
Member Author

@jnothman Revews for this one? The previous version will pass for

_check_is_permutation = lambda indices, n: indices == np.arange(n)

@jnothman
Copy link
Copy Markdown
Member

Sorry, I don't get what you're saying about the previous version.

@jnothman
Copy link
Copy Markdown
Member

Oh. I get what you're saying. You need a np.all.

@jnothman
Copy link
Copy Markdown
Member

I think the obvious case the test is missing is indices = np.hstack([np.arange(n_samples), 0])

@raghavrv
Copy link
Copy Markdown
Member Author

@jnothman Good now?

@jnothman
Copy link
Copy Markdown
Member

LGTM

@jnothman jnothman changed the title [MRG] TST Stronger test for _check_is_permutation [MRG+1] TST Stronger test for _check_is_permutation Sep 12, 2016
@amueller amueller merged commit b18b161 into scikit-learn:master Sep 12, 2016
@raghavrv raghavrv deleted the model_selection_enhancements2 branch September 12, 2016 15:51
rsmith54 pushed a commit to rsmith54/scikit-learn that referenced this pull request Sep 14, 2016
* TST Stronger test for _check_is_permutation

* TST Ensure additional duplicate indices are caught
TomDLT pushed a commit to TomDLT/scikit-learn that referenced this pull request Oct 3, 2016
* TST Stronger test for _check_is_permutation

* TST Ensure additional duplicate indices are caught
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
* TST Stronger test for _check_is_permutation

* TST Ensure additional duplicate indices are caught
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
* TST Stronger test for _check_is_permutation

* TST Ensure additional duplicate indices are caught
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.

3 participants