Ich verwende Python 2.7 unter Ubuntu 14.04. Ich habe scikit-learn, numpy und matplotlib mit diesen Befehlen installiert:
sudo apt-get install build-essential python-dev python-numpy \
python-numpy-dev python-scipy libatlas-dev g++ python-matplotlib \
ipython
Aber wenn ich diese Pakete importiere:
from sklearn.cross_validation import train_test_split
Ich erhalte diese Fehlermeldung:
ImportError: No module named sklearn.cross_validation
Was muss ich tun?
es muss mit der Umbenennung und Abschaffung des Submoduls cross_validation
in model_selection
zusammenhängen. Versuchen Sie, cross_validation
-> model_selection
zu ersetzen
Machen Sie stattdessen Folgendes:
from sklearn.model_selection import train_test_split
Möglicherweise liegt es an der Abschaffung von sklearn.cross_validation. Bitte ersetzen Sie sklearn.cross_validation durch sklearn.model_selection
Betreff: https://github.com/amueller/scipy_2015_sklearn_tutorial/issues/60