import check_arrays from sklearn

后端 未结 4 428
长情又很酷
长情又很酷 2020-12-10 01:47

I\'m trying to use a svm function from the scikit learn package for python but I get the error message:

from sklearn.utils.validation import check_arrays


        
相关标签:
4条回答
  • 2020-12-10 02:25

    This method was removed in 0.16, replaced by a (very different) check_array function. You are likely getting this error because you didn't upgrade from 0.15 to 0.16 properly. [Or because you relied on a not-really-public function in sklearn]. See http://scikit-learn.org/dev/install.html#canopy-and-anaconda-for-all-supported-platforms . If you installed using anaconda / conda, you should use the conda mechanism to upgrade, not pip. Otherwise old .pyc files might remain in your folder.

    0 讨论(0)
  • 2020-12-10 02:30

    It seems like "check_arrays" doesn't exist (anymore). I fixed it with:

    sudo vi /usr/lib64/python2.7/site-packages/sklearn/metrics/cluster/bicluster/bicluster_metrics.py

    change this: from sklearn.utils.validation import check_arrays to: from sklearn.utils.validation import check_array as check_arrays

    Kind of a hack, but it works for me.

    0 讨论(0)
  • 2020-12-10 02:32

    For me...

    This worked:

    from sklearn.utils import check_array
    

    Also this:

    from sklearn.utils.validation import check_array
    

    I am using version 0.16.0

    >>> sklearn.__version__

    '0.16.0'

    Do this:

    import sklearn
    
    print sklearn.__version__
    

    Tell us the results.

    0 讨论(0)
  • 2020-12-10 02:36

    You should change check_arrays to check_array.
    Source: https://github.com/scikit-learn/scikit-learn/issues/4624

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