spore234
spore234

Reputation: 3640

SGDClassifier kernel dies when using scikit

I tried this very simple example

import numpy as np
from sklearn import linear_model
X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]])
Y = np.array([1, 1, 2, 2])
clf = linear_model.SGDClassifier()
clf.fit(X, Y)

but the Kernel dies immediately

Kernel died, restarting

Fitting a Random Forest works without problem:

from sklearn import ensemble
clf2 = ensemble.RandomForestClassifier()
clf2.fit(X, Y)

I have no idea why this occurs. I am using the current version of anaconda3 with all updates on a ubuntu 16.04 64bit system.

UPDATE: I just found that this happens with all model from the linear_model class

UPDATE2: MKL was the problem, as described here: https://github.com/scikit-learn/scikit-learn/issues/5046

and conda install nomkl fixed it.

Upvotes: 2

Views: 4704

Answers (2)

spore234
spore234

Reputation: 3640

MKL is the problem, as described here: https://github.com/scikit-learn/scikit-learn/issues/5046

and conda install nomkl fixes it.

Upvotes: 1

Ioannis Nasios
Ioannis Nasios

Reputation: 8527

You could update your scikit-learn package. If you are using Anaconda update using conda like this:

conda update scikit-learn

if this doesn' t fix the problem

pip install -U scikit-learn

Upvotes: 0

Related Questions