Skip to content
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

ENH add parameter as_frame in fetch_kddcup99 #18280

Merged
merged 20 commits into from Aug 31, 2020

Conversation

glemaitre
Copy link
Contributor

Supersede and closes #17508

Add parameter as_frame to fetch_kddcup99.

def test_OSError_message(fetch_kddcup99_fxt):
expected_msg = ('Download kddcup99 to run this test')
with pytest.raises(OSError, match=expected_msg):
fetch_kddcup99_fxt(data_home="./", download_if_missing=False)
Copy link
Member

Choose a reason for hiding this comment

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

Is this testing code in conftest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. I was not aware of it.

dataset_shuffled = fetch_kddcup99_fxt(
random_state=0, subset='SA', shuffle=True, percent10=True,
)
assert any(dataset_shuffled.target[-100:] == b'normal.')
Copy link
Member

Choose a reason for hiding this comment

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

If this is testing shuffle should we do:

assert set(dataset['target']) == set(dataset_shuffle['target'])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes this is less error-prone even if we added the random state.

Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

LGTM

@thomasjpfan thomasjpfan merged commit 8bab999 into scikit-learn:master Aug 31, 2020
6 of 7 checks passed
jayzed82 pushed a commit to jayzed82/scikit-learn that referenced this pull request Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants