当我教学的时候,我想忽略来自所有软件包的警告,但是 scikit-learn 似乎围绕着使用 warnings
软件包来控制这一点。例如:
with warnings.catch_warnings():
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.signature() instead
if 'order' in inspect.getargspec(np.copy)[0]:
/usr/local/lib/python3.5/site-packages/sklearn/utils/fixes.py:358: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
if 'exist_ok' in inspect.getargspec(os.makedirs).args:
是我使用这个模块不正确,还是 sklearn 做了一些它不应该做的事情?