美文网首页
《Hands on Sklearn and TF》(1)

《Hands on Sklearn and TF》(1)

作者: ironmanblr | 来源:发表于2018-05-09 20:15 被阅读0次

第三章中的MNIST数据集下载问题:


from sklearn.datasets import fetch_mldata

mnist = fetch_mldata('MNIST original')

这里程序会默认从sklearn 中下载MNIST original数据,这样程序运行可能会比较慢。这里是fetch_mldata()的说明:
http://scikit-learn.org/stable/datasets/mldata.html
第一行写到:

mldata.org is a public repository for machine learning data, supported by the PASCAL network .
The sklearn.datasets package is able to directly download data sets from the repository using the functionsklearn.datasets.fetch_mldata.

因此,可以事先去mldata.org(by the way,这个数据库有丰富的数据集可以拿来用) 把MNIST数据集下好,放在当前程序的‘\MNIST_data\mldata’文件夹下。
相应的,源程序改为:


from sklearn.datasets import fetch_mldata

mnist = fetch_mldata('MNIST original',data_home='MNIST_data/') 

本地导入MNIST数据集的结果

这样就可以了

相关文章

网友评论

      本文标题:《Hands on Sklearn and TF》(1)

      本文链接:https://www.haomeiwen.com/subject/xveorftx.html