Warning messages when using python

I get this when I run python SVM code:

Warning (from warnings module): File "/usr/local/lib/python2.7/dist-packages/sklearn/cross_validation.py", line 44 "This module will be removed in 0.20.", DeprecationWarning) DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20. Warning (from warnings module): File "/usr/local/lib/python2.7/dist-packages/sklearn/grid_search.py", line 43 DeprecationWarning) DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. This module will be removed in 0.20. 

What do these warning messages mean?

Thanks at Advance

+6
source share
3 answers

The latest stable version of scikit-learn is 0.18 http://scikit-learn.org/stable/

The version used is outdated for these modules.
Alternatively use

  from sklearn.model_selection import train_test_split 

Look at this discussion
https://github.com/rhiever/tpot/issues/284
and this comment:
https://github.com/rhiever/tpot/commit/84c5e26b447251088826737612ccf0817ef43db2

+17
source

This means that the SVM scikit-learn module internally uses the cross_validation and grid_search modules. Both will be replaced in version 0.20 with model_selection equivalents. Therefore, you do not need to worry, as soon as you upgrade scikit-learn to the next version, you should no longer see warnings.

0
source

I was getting the same error when running python file from terminal. The RuntimeError description suggested installing a python application and using pythonw instead of python, and I did just that. Luckily, it worked for me.

pythonw filename.py

0
source

Source: https://habr.com/ru/post/1013327/


All Articles