When I'm fitting sklearn
's LogisticRegression
using a 1 column python pandas
DataFrame
(not a Series
object), I get this warning:
/Library/Python/2.7/site-packages/sklearn/preprocessing/label.py:125: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel(). y = column_or_1d(y, warn=True)
I know I could easily advert this warning in my code, but how can I turn off these warnings?
simplefilter("ignore") from sklearn import preprocessing /usr/local/lib/python3. 5/site-packages/sklearn/utils/fixes. py:66: DeprecationWarning: inspect. getargspec() is deprecated, use inspect.
DeprecationWarning. Base category for warnings about deprecated features when those warnings are intended for other Python developers (ignored by default, unless triggered by code in __main__ ). SyntaxWarning. Base category for warnings about dubious syntactic features.
FutureWarning messages are designed to inform you about upcoming changes to default values for arguments in the scikit-learn API. FutureWarning messages can be ignored or suppressed as they do not halt the execution of your program.
You can use this:
import warnings from sklearn.exceptions import DataConversionWarning warnings.filterwarnings(action='ignore', category=DataConversionWarning)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With