How to use datasets.fetch_mldata() in sklearn?

后端 未结 11 2054
半阙折子戏
半阙折子戏 2020-12-30 05:42

I am trying to run the following code for a brief machine learning algorithm:

import re
import argparse
import csv
from collections import Counter
from sklea         


        
11条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 06:01

    As of version 0.20, sklearn deprecates fetch_mldata function and adds fetch_openml instead.

    Download MNIST dataset with the following code:

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

    There are some changes to the format though. For instance, mnist['target'] is an array of string category labels (not floats as before).

提交回复
热议问题