python - sklearn: Turning off warnings -


when i'm fitting sklearn's logisticregression using 1 column python pandas dataframe (not series object), warning:

/library/python/2.7/site-packages/sklearn/preprocessing/label.py:125:          dataconversionwarning: column-vector y passed when 1d array  expected. please change shape of y (n_samples, ), example using  ravel(). y = column_or_1d(y, warn=true) 

i know advert warning in code, how can turn off these warnings?

as posted here,

with warnings.catch_warnings():     warnings.simplefilter("ignore")     # stuff here 

thanks andreas above posting link.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -