我想通過Python中的Keras Deep Learning Library學習神經網絡。我使用Python 3和參考以下鏈接:Tutorial LinkPython 3:沒有名爲'sklearn.model_selection'的模塊
我嘗試運行下面的代碼,但出現以下錯誤:
導入錯誤:沒有名爲「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
任何模塊非常感謝幫助!
謝謝你的指令。我結束了安裝更新,但它仍然在這裏出現錯誤: ImportError:無法導入名稱'rankdata'; ---> 32 from ..utils.fixes import rankdata – PineNuts0
這很可能是你用conda安裝的,但用pip更新的。不要這樣做。卸載scikit-learn,刪除文件夾,然後使用conda或pip重新安裝。如果您使用anaconda,我會推薦conda。通過@amueller on GitHub –
是的,你是正確的;我安裝了conda。我發現用'conda install ...'更新我的numpy會自動更新一切 – PineNuts0