Update 03_classification.ipynb
Create a function parameter for improved consistency.main
parent
d17126475d
commit
a102114c62
|
@ -1903,10 +1903,10 @@
|
|||
"SPAM_URL = DOWNLOAD_ROOT + \"20030228_spam.tar.bz2\"\n",
|
||||
"SPAM_PATH = os.path.join(\"datasets\", \"spam\")\n",
|
||||
"\n",
|
||||
"def fetch_spam_data(spam_url=SPAM_URL, spam_path=SPAM_PATH):\n",
|
||||
"def fetch_spam_data(ham_url=HAM_URL, spam_url=SPAM_URL, spam_path=SPAM_PATH):\n",
|
||||
" if not os.path.isdir(spam_path):\n",
|
||||
" os.makedirs(spam_path)\n",
|
||||
" for filename, url in ((\"ham.tar.bz2\", HAM_URL), (\"spam.tar.bz2\", spam_url)):\n",
|
||||
" for filename, url in ((\"ham.tar.bz2\", ham_url), (\"spam.tar.bz2\", spam_url)):\n",
|
||||
" path = os.path.join(spam_path, filename)\n",
|
||||
" if not os.path.isfile(path):\n",
|
||||
" urllib.request.urlretrieve(url, path)\n",
|
||||
|
|
Loading…
Reference in New Issue