弃用警告

时间:2017-06-20 21:31:41

标签: python python-3.x jupyter-notebook data-analysis xgboost

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)

请告诉我为什么会出现此警告以及如何解决此问题?

1 个答案:

答案 0 :(得分:0)

使用

from sklearn.model_selection import cross_val_score

相反

from sklearn.cross_validation import cross_val_score