ImportError: cannot import name 'cross_validate'

前端 未结 3 2009
广开言路
广开言路 2021-02-18 17:00

I\'m trying to do:

from sklearn.model_selection import cross_validate

as mentioned here. But get the error:

ImportError: cannot         


        
相关标签:
3条回答
  • 2021-02-18 17:10

    from sklearn.model_selection import cross_validate

    0 讨论(0)
  • 2021-02-18 17:13

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

    from sklearn.model_selection import train_test_split
    

    Refer Documentation

    0 讨论(0)
  • 2021-02-18 17:23

    cross-validate is new in version 0.19.0 (change log):

    Cross validation is now able to return the results from multiple metric evaluations. The new model_selection.cross_validate can return many scores on the test data as well as training set performance and timings, and we have extended the scoring and refit parameters for grid/randomized search to handle multiple metrics.

    In order to use it update your scikit-learn installation with either conda upgrade scikit-learn if you are using conda, or pip install --upgrade scikit-learn. If updating is not possible, you can still use cross_val_score instead.

    0 讨论(0)
提交回复
热议问题