sklearn.utils.deprecated?

sklearn.utils.deprecated(extra='')

源碼

裝飾器,用于將功能或類標記為不推薦使用。

調用函數/實例化類時發出警告,并將警告添加到文檔字符串。

可選的extra參數將附加到棄用消息和文檔字符串中。 注意:要將其與默認值一起使用時,請在括號中留空:

>>> from sklearn.utils import deprecated
>>> deprecated()
<sklearn.utils.deprecation.deprecated object at ...>
>>> @deprecated()
... def some_function(): pass
參數 說明
extra string
添加到棄用消息中