[scikit-learn] MLPClassifier on WIndows 10 is 4 times slower than that on macOS?

Kouichi Matsuda kouichi.matsuda at gmail.com
Sat Dec 15 09:02:06 EST 2018


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20181215/c029db3b/attachment.html>


More information about the scikit-learn mailing list