Skip to content
Snippets Groups Projects
Commit 587bf3ac authored by Loic Esteve's avatar Loic Esteve Committed by Tom Dupré la Tour
Browse files

Add data_home parameter to fetch_kddcup99 (#9289)

parent cf67fa43
No related branches found
No related tags found
No related merge requests found
...@@ -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
------------------- -------------------
......
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment