ImportError: No module named model_selection

后端 未结 11 598
攒了一身酷
攒了一身酷 2021-01-30 08:16

I am trying to use train_test_split function and write:

from sklearn.model_selection import train_test_split

and this causes

11条回答
  •  -上瘾入骨i
    2021-01-30 08:35

    Latest Stable release of sklearn 0.20.0 has train_test_split is under model_selection not under cross_validation

    In order to check your sklearn version :

    import sklearn print (sklearn.version) 0.20.2

提交回复
热议问题