首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么从yellowbrick.target导入FeatureCorrelation运行会导致sklearn.metrics.classification错误?

为什么从yellowbrick.target导入FeatureCorrelation运行会导致sklearn.metrics.classification错误?
EN

Stack Overflow用户
提问于 2020-05-23 06:04:38
回答 1查看 255关注 0票数 0

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

我所做的

代码语言:javascript
复制
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)

警告Msg

/Users/georgeng/opt/anaconda3/lib/python3.7/site-packages/sklearn/utils/deprecation.py:144

FutureWarning:在0.22版中不推荐使用sklearn.metrics.classification模块,在0.24版中将删除该模块。相应的类/函数应该从sklearn.metrics导入。任何不能从sklearn.metrics导入的内容现在都是私有API的一部分。warnings.warn(message,FutureWarning)

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

感谢你的帮助。乔治

EN

回答 1

Stack Overflow用户

发布于 2020-05-23 08:00:43

您不直接使用sklearn,但yellowbrick使用它。

只运行这一行来查看它。

代码语言:javascript
复制
 from yellowbrick.target import FeatureCorrelation

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

此时,您可以使用模块warnings筛选警告。

代码语言:javascript
复制
import warnings
warnings.simplefilter("ignore")

from yellowbrick.target import FeatureCorrelation
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61968142

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档