Deprecation warning in scikit-learn svmlight format loader

后端 未结 2 759
面向向阳花
面向向阳花 2021-02-13 07:13

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:38

    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.

提交回复
热议问题