import operator
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import xgboost as xgb
import seaborn as sns
%matplotlib inline
pd.set_option('display.max_columns', 50)
导入上述文件后,我得到了一个模块未找到错误,因为我没有安装xboost,因为我是python和数据分析的新手。弃用警告
然后我直接从here安装它。
现在安装xgboost我得到了一条反对预警相同的代码上面的线是如下之后:
C:\ProgramData\Anaconda3\lib\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)
请告诉我为什么,该警报显示出来,如何解决这个问题?
这意味着,在产品的代码更高版本使用的是将不再工作。阅读'model_selection'模块的文档,并将代码放入其中,以便用户可以在更高版本中使用您的代码。 – rassar
Sklearn将会停止交叉验证。他们把在cross_validation下的类放到model_selection中。我认为XGBoost也已更新,因为它们使用'try' /'except'来导入'KFold','StratifiedKFold'(例如[https://github.com/dmlc/xgboost/blob/6f16f0ef5829965ba420ef6937617600d286820a/python-包/ xgboost/compat.py#L51))。 – Jarad