8000 Add data_home parameter to fetch_kddcup99 · scikit-learn/scikit-learn@5a3dc75 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a3dc75

Browse files
committed
Add data_home parameter to fetch_kddcup99
1 parent 51c8c16 commit 5a3dc75

File tree

2 files changed

+13
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,9 @@ Bug fixes
459459
<musically-ut>`, and `Joel Nothman`_.
460460

461461

462+
- Add ``data_home`` parameter to
463+
:func:`sklearn.datasets.fetch_kddcup99` by `Loic Esteve`_.
464+
462465
API changes summary
463466
-------------------
464467

Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
logger = logging.getLogger()
4040

4141

42-
def fetch_kddcup99(subset=None, shuffle=False, random_state=None,
42+
def fetch_kddcup99(subset=None, data_home=None, shuffle=False,
43+
random_state=None,
4344
percent10=True, download_if_missing=True):
4445
"""Load and return the kddcup 99 dataset (classification).
4546
@@ -124,6 +125,11 @@ def fetch_kddcup99(subset=None, shuffle=False, random_state=None,
124125
To return the corresponding classical subsets of kddcup 99.
125126
If None, return the entire kddcup 99 dataset.
126127
128+
data_home : string, optional
129+
Specify another download and cache folder for the datasets. By default
130+
all scikit-learn data is stored in '~/scikit_learn_data' subfolders.
131+
.. versionadded:: 0.19
132+
127133
random_state : int, RandomState instance or None, optional (default=None)
128134
Random state for shuffling the dataset.
129135
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,
162168
and data mining, pages 320-324. ACM Press, 2000.
163169
164170
"""
165-
kddcup99 = _fetch_brute_kddcup99(shuffle=shuffle, percent10=percent10,
171+
data_home = get_data_home(data_home=data_home)
172+
kddcup99 = _fetch_brute_kddcup99(data_home=data_home, shuffle=shuffle,
173+
percent10=percent10,
166174
download_if_missing=download_if_missing)
167175

168176
data = kddcup99.data