[PYTHON] Importieren Sie aus sklearn.datasets fetch_mldata-> fetch_openml

Hintergrund

Ein Ereignis, das auftrat, als ich versuchte, mich mit t-SNE zu gruppieren und verschiedene Beispielcodes fischte Ich habe in Bezug darauf codiert

Ort des Auftretens

Teil 1

import matplotlib.pyplot as plt
from mpl.toolkits.mplot3d import Axes3D
import seaborn as sns
from __future__ import print_function
from sklearn.datasets import fetch_openml # <-Hier
from sklearn.decompositon import PCA
from sklearn.manifold import TSNE

%matplotlib inline

Teil 2

mnist = fetch_mldata("MNIST original") # <-Hier
X = mnist.data / 255.0
y = mnist.target
print(X.shape, y.shape)

Korrekturcode

Teil 1

import matplotlib.pyplot as plt
from mpl.toolkits.mplot3d import Axes3D
import seaborn as sns
from __future__ import print_function
from sklearn.datasets import fetch_openml # <-Hier
from sklearn.decompositon import PCA
from sklearn.manifold import TSNE

%matplotlib inline

Teil 2

mnist = fetch_openml('mnist_784', version=1,) # <-Hier
X = mnist.data / 255.0
y = mnist.target

print(X.shape, y.shape)

Ursache

Es scheint, dass die Ursache darin besteht, dass https://openml.org, das Referenzziel von fetch_mldata, nicht verfügbar ist.

Referenz

Recommended Posts

Importieren Sie aus sklearn.datasets fetch_mldata-> fetch_openml
Python aus oder importieren
Von sys import stderr oder import sys → sys.stderr
Django: Klasse aus String importieren
python> link> from __future__ importiere absolute_import