我正在尝试通过Python中的Keras深度学习库学习神经网络。我正在使用Python3,并引用了这个链接:Tutorial Link
我尝试运行下面的代码,但得到以下错误:
ImportError:没有名为“sklearn.model_selection”的模块
import numpy
import pandas
from keras.models import Sequential
from keras.layers import Dense
from keras.wrappers.scikit_learn import KerasRegressor
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import KFold
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import Pipeline任何帮助都是非常感谢的!
发布于 2017-04-25 10:41:37
我想你安装了错误的sklearn版本。
请尝试这个:import sklearn print (sklearn.__version__) 0.17.1
如果您的版本低于0.18,请使用pip install -U scikit-learn或pip3 install -U scikit-learn进行更新
如果您有import Error,请使用pip install scikit-learn或pip3 install scikit-learn安装sklearn
发布于 2018-02-06 23:34:46
在python3上试试这个
pip3 install -U scikit-learn发布于 2017-12-29 23:35:12
此命令适用于我在ubuntu和Python 2中的应用:
sudo apt-get install python-sklearn 对于Python 3,请使用以下命令:
sudo apt install python3-sklearn https://stackoverflow.com/questions/43600350
复制相似问题