python3.6中在sklearn.linear_model模块出现FutureWarning错误

错误类型:FutureWaring

D:\software\python3.6\lib\site-packages\sklearn\linear_model\stochastic_gradient.py:128: FutureWarning: max_iter and tol parameters have been added in <class 'sklearn.linear_model.stochastic_gradient.SGDClassifier'> in 0.19. If both are left unset, they default to max_iter=5 and tol=None. If tol is not None, max_iter defaults to max_iter=1000. From 0.21, default max_iter will be 1000, and default tol will be 1e-3.
  "and default tol will be 1e-3." % type(self), FutureWarning)

解决方法:
 
   
from sklearn.linear_model import SGDClassifier
sgdc = SGDClassifier()
 
  

改为:
 
  
from sklearn.linear_model import stochastic_gradient
    sgdc = stochastic_gradient.SGDClassifier()



你可能感兴趣的:(python,Python错误类型,机器学习&深度学习)