Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sklearn.linear_model not found in TensorFlow Udacity course

I'm following the instructions of the Deep Learning course by Google with TensorFlow. Unfortunately I'm stuck with this workbook right now. I work in the docker vm with all the assignment code loaded as described here.

When I do all the imports everything works except for following line:

from sklearn.linear_model import LogisticRegression

it throws the following error:

>>> from sklearn.linear_model import LogisticRegression
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named sklearn.linear_model

This SO answer sounds promising, but I did not find the source directory of sklearn.

Any help greatly aprreciated.

like image 959
Jonny Avatar asked Feb 03 '16 07:02

Jonny


1 Answers

You can install and upgrade sklearn from the shell with pip. That may or may not be the problem - but at least you'll know its installed.

sudo pip install --upgrade scikit-learn
like image 112
Keith Brodie Avatar answered Sep 19 '22 00:09

Keith Brodie