ImportError: No module named model_selection

后端 未结 11 602
攒了一身酷
攒了一身酷 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条回答
  •  温柔的废话
    2021-01-30 08:41

    do you have sklearn? if not, do the following:

    sudo pip install sklearn
    

    After installing sklearn

    from sklearn.model_selection import train_test_split
    

    works fine

提交回复
热议问题