首页 > 解决方案 > 每次运行 Jupyter Notebook 时,是否必须使用 fetch_openml 重新下载 MNIST?

问题描述

一切都在标题中。我在笔记本中运行以下代码:

from sklearn.datasets import fetch_openml
mnist = fetch_openml('mnist_784', version=1)

但是每次我重新打开我的笔记本时都必须重新获取数据集吗?有没有办法在本地存储数据集?谢谢

标签: pythonscikit-learnjupyter-notebookdatasetmnist

解决方案


Scikit-learnfetchers 有 param data_home,你可以指定它。它的默认值为None. 在这种情况下,数据存储在~/scikit_learn_data子文件夹中。更多参数见fetch_openml?


推荐阅读