web-dev-qa-db-fra.com

SCIKIT-HORS - Impossible de charger le jeu de données original mnist à l'aide de FETCH_OPENML IN Python

J'essaie de charger le jeu de données original du mnist en Python. Le sklearn.datasets.fetch_openml La fonction ne semble pas fonctionner pour cela.

Voici le code que j'utilise-

from sklearn.datasets import fetch_openml
dataset = fetch_openml("MNIST Original") 

Je reçois cette erreur-

File "generateClassifier.py", line 11, in <module>
  dataset = fetch_openml("MNIST Original")
  File "/home/inglorion/.local/lib/python3.5/site- 
packages/sklearn/datasets/openml.py", line 526, in fetch_openml
data_info = _get_data_info_by_name(name, version, data_home)
  File "/home/inglorion/.local/lib/python3.5/site- 
packages/sklearn/datasets/openml.py", line 302, in 
_get_data_info_by_name
    data_home)
  File "/home/inglorion/.local/lib/python3.5/site- 
packages/sklearn/datasets/openml.py", line 169, in 
_get_json_content_from_openml_api
    raise error
  File "/home/inglorion/.local/lib/python3.5/site- 
packages/sklearn/datasets/openml.py", line 164, in 
_get_json_content_from_openml_api
    return _load_json()
  File "/home/inglorion/.local/lib/python3.5/site- 
packages/sklearn/datasets/openml.py", line 52, in wrapper
    return f()
  File "/home/inglorion/.local/lib/python3.5/site- 
packages/sklearn/datasets/openml.py", line 160, in _load_json
    with closing(_open_openml_url(url, data_home)) as response:
  File "/home/inglorion/.local/lib/python3.5/site- 
packages/sklearn/datasets/openml.py", line 109, in _open_openml_url
with closing(urlopen(req)) as fsrc:
  File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.5/urllib/request.py", line 472, in open
    response = meth(req, response)
  File "/usr/lib/python3.5/urllib/request.py", line 582, in 
http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.5/urllib/request.py", line 510, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 444, in 
_call_chain
    result = func(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 590, in 
http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
        urllib.error.HTTPError: HTTP Error 400: Bad Request

Comment puis-je réparer cela? Alternativement, y a-t-il une autre façon de charger le jeu de données Mnist dans Python?

J'utilise la version 0.20.2 de scikit-learn.

Je suis relativement nouveau à la programmation en général, alors j'apprécierais que je puisse avoir une réponse simple. Merci!

7
Inglorion

Essayer

mnist = fetch_openml('mnist_784')

Je l'ai trouvé via https://www.openml.org/ sous https://www.openml.org/d/554

9
bav av

vous pouvez utiliser:

mist = fetch_openml('mnist_784', version=1)
2
bforblack