Hi Hi everyone, I am writing a scikit-learn program to use MLPClassifier to learn Fashion-MNIST. The following is the program. It's very simple. When I ran it on Windows 10 (Core-i7-8565U, 1.8GHz, 16GB) note book, it took about 4 minutes. However, when I ran it on MacBook(macOS), it took about 1 minutes. Does anyone help me to understand the reason why Windows 10 is so slow? Am I missing something?
Thanks, import os import gzip import numpy as np #from https://github.com/zalandoresearch/fashion-mnist/blob/master/utils/mnist_reader.py def load_mnist(path, kind='train'): labels_path = os.path.join(path,'%s-labels-idx1-ubyte.gz' % kind) images_path = os.path.join(path,'%s-images-idx3-ubyte.gz' % kind) with gzip.open(labels_path, 'rb') as lbpath: labels = np.frombuffer(lbpath.read(), dtype=np.uint8, offset=8) with gzip.open(images_path, 'rb') as imgpath: images = np.frombuffer(imgpath.read(), dtype=np.uint8, offset=16) images = images.reshape(len(labels), 784) return images, labels x_train, y_train = load_mnist('data', kind='train') x_test, y_test = load_mnist('data', kind='t10k') from sklearn.neural_network import MLPClassifier import time import datetime print(datetime.datetime.today()) start = time.time() mlp = MLPClassifier() mlp.fit(x_train, y_train) print((time.time() - start)/ 60) --- MATSUDA, Kouichi, Ph.D.
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn