ImportError: cannot import name cross_validation

后端 未结 4 1137
没有蜡笔的小新
没有蜡笔的小新 2020-12-03 11:50

I cannot import the cross_validation from sklearn library; I use sklearn version 0.20.0

from sklearn import cross_validation

later in the c

4条回答
  •  忘掉有多难
    2020-12-03 12:34

    In my case, I was using some files from a Udacity course, which used an older version of sklearn. Instead of spending unnecessary time reformatting code usage to meet the latest versions of all their dependencies, it was easier to install the old version.

    This was possible because they provide a requirements.txt file.

    python -m pip install -r requirements.txt

提交回复
热议问题