【发布时间】:2017-12-28 07:12:30
【问题描述】:
我正在使用 XGBoost 的 XGBClassifier()。我收到以下弃用警告。
有什么办法可以消除这个警告吗?
/home/carnd/anaconda3/envs/dl/lib/python3.5/site-packages/sklearn/cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
在 64 GB CPU 机器上运行 2 小时后,它仍在运行。我不确定所花费的时间可能是因为这个弃用警告还是只是数据集的长度。
【问题讨论】:
-
它基本上告诉你发生了什么:cross_validation 模块正在被删除/重命名。现在这没问题,但是您的代码不会在更高版本中运行。我认为它现在称为model_selection。 (警告不是您观察性能的来源)
-
在这种情况下,这表明
XGBClassifier位于xgboost包中,使用了已弃用的方法或scikit-learn包中的类。 -
谢谢大家。该模型需要异常时间才能运行。这就是我发布这个问题的原因。我知道这很愚蠢。
标签: python-3.x scikit-learn xgboost