Deprecation warning in scikit-learn svmlight format loader

后端 未结 2 1911
渐次进展
渐次进展 2021-02-13 06:47

I\'m getting a new deprecation warning in an IPython notebook I wrote that I\'ve not seen before. What I\'m seeing is the following:

X,y = load_svmlight_file(\'.         


        
相关标签:
2条回答
  • 2021-02-13 07:35

    After you upgrade numpy, it gives you this deprecation warning whenever you try to index an array using non-integer numbers. In sklearn there are many places where the data type is a floating point number even though the indices are all integer values when computed.

    So whenever you index an array in numpy, you need to make sure the indices are integer typed. But this is not the case in many places in sklearn. The fix is sometimes trivial (for example use // instead of / when computing indices using divisions), sometimes not, but for now, no worries, it's just a warning.

    0 讨论(0)
  • 2021-02-13 07:46

    You probably upgraded the numpy version, as this is a numpy 1.8.0 deprecation warning. Explained in this pull request. Continuation in this PR.

    Briefly browsing the sklearn issue tracker, I haven't found any related issues. You can probably search better and file a bug report if not found.

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