Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python sklearn. Why I received warnings first time only?

I received warnings first time only. Is this normal?

>>> cv=LassoCV(cv=10).fit(x,y)
C:\Python27\lib\site-packages\scikit_learn-0.14.1-py2.7-win32.egg\sklearn\linear_model\coordinate_descent.py:418: UserWarning: Objective did not converge. You might want to increase the number of iterations
  ' to increase the number of iterations')
>>> cv=LassoCV(cv=10).fit(x,y) 
>>> 
like image 590
Donbeo Avatar asked Dec 02 '25 05:12

Donbeo


1 Answers

It's because the python warnings filter is set to just warn the first time it catches a particular warning by default.

If you want to get all the warnings, just add this:

import warnings
warnings.simplefilter("always")
like image 114
Derek Farren Avatar answered Dec 03 '25 18:12

Derek Farren



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!