mirror of
https://github.com/ArthurDanjou/handson-ml3.git
synced 2026-01-14 12:14:36 +01:00
Use as_frame=False when calling fetch_openml()
This commit is contained in:
@@ -969,6 +969,13 @@
|
||||
"If the dataset does not fit in memory, the simplest option is to use the `memmap` class, just like we did for incremental PCA in the previous chapter. First let's load MNIST:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"**Warning:** since Scikit-Learn 0.24, `fetch_openml()` returns a Pandas `DataFrame` by default. To avoid this and keep the same code as in the book, we use `as_frame=False`."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 46,
|
||||
@@ -978,7 +985,7 @@
|
||||
"import urllib.request\n",
|
||||
"from sklearn.datasets import fetch_openml\n",
|
||||
"\n",
|
||||
"mnist = fetch_openml('mnist_784', version=1)\n",
|
||||
"mnist = fetch_openml('mnist_784', version=1, as_frame=False)\n",
|
||||
"mnist.target = mnist.target.astype(np.int64)"
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user