Update 03_classification.ipynb
Use a function parameter instead of a global constant.main
parent
1e81324573
commit
d17126475d
|
@ -1906,12 +1906,12 @@
|
|||
"def fetch_spam_data(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",
|
||||
" tar_bz2_file = tarfile.open(path)\n",
|
||||
" tar_bz2_file.extractall(path=SPAM_PATH)\n",
|
||||
" tar_bz2_file.extractall(path=spam_path)\n",
|
||||
" tar_bz2_file.close()"
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue