歡迎您光臨本站 註冊首頁

python中導入 train

←手機掃碼閱讀     ml5rwbikls @ 2020-06-21 , reply:0

如下所示:

原因:

在python3.6中sklearn已棄用train_test_split,導致導入報錯

解決方式,用model_selection模塊導入:

from sklearn.model_selection import train_test_split

經測試,在python2中也是使用該方式導入train_test_split模塊

補充知識:from sklearn.model_selection import train_test_split找不到模塊

解決方案:

pip uninstall numpy

pip install numpy==1.16(或pip install numpy==1.14.5)

如果提示權限不夠,‘[WinError 5]拒絕訪問',則需打開管理員權限

 

                                                     

   


[ml5rwbikls ] python中導入 train已經有226次圍觀

http://coctec.com/docs/python/shhow-post-239300.html