Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scikit-learn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ian Johnson
scikit-learn
Commits
587bf3ac
Commit
587bf3ac
authored
7 years ago
by
Loic Esteve
Committed by
Tom Dupré la Tour
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add data_home parameter to fetch_kddcup99 (#9289)
parent
cf67fa43
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/whats_new.rst
+3
-0
3 additions, 0 deletions
doc/whats_new.rst
sklearn/datasets/kddcup99.py
+10
-2
10 additions, 2 deletions
sklearn/datasets/kddcup99.py
with
13 additions
and
2 deletions
doc/whats_new.rst
+
3
−
0
View file @
587bf3ac
...
@@ -459,6 +459,9 @@ Bug fixes
...
@@ -459,6 +459,9 @@ Bug fixes
<musically-ut>`, and `Joel Nothman`_.
<musically-ut>`, and `Joel Nothman`_.
- Add ``data_home`` parameter to
:func:`sklearn.datasets.fetch_kddcup99` by `Loic Esteve`_.
API changes summary
API changes summary
-------------------
-------------------
...
...
This diff is collapsed.
Click to expand it.
sklearn/datasets/kddcup99.py
+
10
−
2
View file @
587bf3ac
...
@@ -39,7 +39,8 @@ URL = ('http://archive.ics.uci.edu/ml/'
...
@@ -39,7 +39,8 @@ URL = ('http://archive.ics.uci.edu/ml/'
logger
=
logging
.
getLogger
()
logger
=
logging
.
getLogger
()
def
fetch_kddcup99
(
subset
=
None
,
shuffle
=
False
,
random_state
=
None
,
def
fetch_kddcup99
(
subset
=
None
,
data_home
=
None
,
shuffle
=
False
,
random_state
=
None
,
percent10
=
True
,
download_if_missing
=
True
):
percent10
=
True
,
download_if_missing
=
True
):
"""
Load and return the kddcup 99 dataset (classification).
"""
Load and return the kddcup 99 dataset (classification).
...
@@ -124,6 +125,11 @@ def fetch_kddcup99(subset=None, shuffle=False, random_state=None,
...
@@ -124,6 +125,11 @@ def fetch_kddcup99(subset=None, shuffle=False, random_state=None,
To return the corresponding classical subsets of kddcup 99.
To return the corresponding classical subsets of kddcup 99.
If None, return the entire kddcup 99 dataset.
If None, return the entire kddcup 99 dataset.
data_home : string, optional
Specify another download and cache folder for the datasets. By default
all scikit-learn data is stored in
'
~/scikit_learn_data
'
subfolders.
.. versionadded:: 0.19
random_state : int, RandomState instance or None, optional (default=None)
random_state : int, RandomState instance or None, optional (default=None)
Random state for shuffling the dataset.
Random state for shuffling the dataset.
If int, random_state is the seed used by the random number generator;
If int, random_state is the seed used by the random number generator;
...
@@ -162,7 +168,9 @@ def fetch_kddcup99(subset=None, shuffle=False, random_state=None,
...
@@ -162,7 +168,9 @@ def fetch_kddcup99(subset=None, shuffle=False, random_state=None,
and data mining, pages 320-324. ACM Press, 2000.
and data mining, pages 320-324. ACM Press, 2000.
"""
"""
kddcup99
=
_fetch_brute_kddcup99
(
shuffle
=
shuffle
,
percent10
=
percent10
,
data_home
=
get_data_home
(
data_home
=
data_home
)
kddcup99
=
_fetch_brute_kddcup99
(
data_home
=
data_home
,
shuffle
=
shuffle
,
percent10
=
percent10
,
download_if_missing
=
download_if_missing
)
download_if_missing
=
download_if_missing
)
data
=
kddcup99
.
data
data
=
kddcup99
.
data
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment