Move datasets to project ageron/data to shrink this repo

This commit is contained in:
Aurélien Geron
2022-02-19 21:36:43 +13:00
parent 8745a9c2ac
commit c9b977309a
6 changed files with 27 additions and 31 deletions

View File

@@ -895,7 +895,6 @@
"metadata": {},
"outputs": [],
"source": [
"import urllib.request\n",
"from sklearn.datasets import fetch_openml\n",
"\n",
"mnist = fetch_openml('mnist_784', as_frame=False)"
@@ -1303,14 +1302,16 @@
"metadata": {},
"outputs": [],
"source": [
"# extra code\n",
"# extra code downloads the ladybug image\n",
"\n",
"root = \"https://raw.githubusercontent.com/ageron/handson-ml3/main/\"\n",
"import urllib.request\n",
"\n",
"homl3_root = \"https://github.com/ageron/handson-ml3/raw/main/\"\n",
"filename = \"ladybug.png\"\n",
"filepath = IMAGES_PATH / filename\n",
"if not filepath.is_file():\n",
" print(\"Downloading\", filename)\n",
" url = f\"{root}/images/unsupervised_learning/{filename}\"\n",
" url = f\"{homl3_root}/images/unsupervised_learning/{filename}\"\n",
" urllib.request.urlretrieve(url, filepath)"
]
},