python error- (sklearn) ImportError: No module named cross_validation

from sklearn.cross_validation import train_test_split

  

ERROR:
ImportError: No module named sklearn.cross_validation

解决方案:
it must relate to the renaming and depreaction of cross_validation submodule to model_selection. Try substituting cross_validation -> model_selection

   train_test_split is now in model_selection. Just type:

from sklearn.model_selection import train_test_split

  

Reference:
https://stackoverflow.com/questions/30667525/importerror-no-module-named-sklearn-cross-validation



    原文作者:Shirley_BHU
    原文地址: https://www.cnblogs.com/shirley-bhu/p/10668428.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞