0

我的目标是避免下面的警告信息

我做了什么

house_data = pd.read_csv('datasets/house_data_processed.csv')
target = house_data['price']
features = house_data.drop('price', axis=1)
features.columns
from yellowbrick.target import FeatureCorrelation
feature_names = list(features.columns)

警告信息

/Users/georgeng/opt/anaconda3/lib/python3.7/site-packages/sklearn/utils/deprecation.py:144 FutureWarning:sklearn.metrics.classification 模块在 0.22 版中已弃用,将在 0.24 版中删除。应该从 sklearn.metrics 导入相应的类/函数。任何不能从 sklearn.metrics 导入的东西现在都是私有 API 的一部分。warnings.warn(消息,FutureWarning)

问题 - 我在上面的冒犯性声明中没有使用 sklearn,为什么警告消息暗示我使用了 sklearn.metrics.classification?

谢谢你的帮助。乔治

4

1 回答 1

0

您不sklearn直接使用,而是yellowbrick使用它。

只运行这一行来查看它

 from yellowbrick.target import FeatureCorrelation

将此问题发送给yelolowbrick作者并要求他更改代码。

此时您可以使用模块warnings来过滤警告

import warnings
warnings.simplefilter("ignore")

from yellowbrick.target import FeatureCorrelation
于 2020-05-23T08:00:43.657 回答