ImportError: cannot import name 'cross_validate'

Viewed 28358

I'm trying to do:

from sklearn.model_selection import cross_validate

as mentioned here. But get the error:

ImportError: cannot import name 'cross_validate'

Everything else in Sklearn seems to work fine, it's just this bit. Error even occurs when I run this one line and nothing else.

3 Answers

On the latest stable version, 0.20.0, it is located underneath model_selection.

from sklearn.model_selection import train_test_split

Refer Documentation

from sklearn.model_selection import cross_validate

Related