当我适合的时候sklearn
's LogisticRegression
使用 1 列 pythonpandas
DataFrame
(not a Series
对象),我收到此警告:
/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)
我知道我可以轻松地在代码中发布此警告,但如何关闭这些警告?
你可以使用这个:
import warnings
from sklearn.exceptions import DataConversionWarning
warnings.filterwarnings(action='ignore', category=DataConversionWarning)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)