Yellowbrick使用笔记6-分类可视化

2023-02-27 00:00:00 模型 分类 阈值 可视化 召回

分类模型试图在一个离散的空间中预测一个目标,即为一个因变量实例分配一个或多个类别。
代码下载

分类分数可视化工具显示类之间的差异以及一些特定于分类器的可视化评估。我们目前已经实施了以下分类器评估:

  • 分类报告Classification Report:视觉分类报告,将每个类别的精度,召回率和F1显示为热图。
  • 混淆矩阵Confusion Matrix:多类分类中混淆矩阵的热图视图。
  • ROCAUC: 绘制训练器的工作特性和曲线下面积
  • Precision-Recall曲线:绘制不同概率阈值的精度和召回率。
  • 类平衡:目视检查目标,以向终评估者显示每个类的支持。
  • 类预测错误:混淆矩阵的另一种选择,它显示实际类和预测类之间的支持和差异。
  • 辨别阈值:显示使用辨别概率或分数的二进制分类器在所有阈值上的度、召回率、F1和队列率。

本文如果数据集下载不下来,查看下面地址,然后放入yellowbrick安装目录\datasets\fixtures文件夹:

{
"bikeshare": {
"url": "https://s3.amazonaws.com/ddl-> "signature": "4ed07a929ccbe0171309129e6adda1c4390190385dd6001ba9eecc795a21eef2"
},
"hobbies": {
"url": "https://s3.amazonaws.com/ddl-> "signature": "6114e32f46baddf049a18fb05bad3efa98f4e6a0fe87066c94071541cb1e906f"
},
"concrete": {
"url": "https://s3.amazonaws.com/ddl-> "signature": "5807af2f04e14e407f61e66a4f3daf910361a99bb5052809096b47d3cccdfc0a"
},
"credit": {
"url": "https://s3.amazonaws.com/ddl-> "signature": "2c6f5821c4039d70e901cc079d1404f6f49c3d6815871231c40348a69ae26573"
},
"energy": {
"url": "https://s3.amazonaws.com/ddl-> "signature": "174eca3cd81e888fc416c006de77dbe5f89d643b20319902a0362e2f1972a34e"
},
"game": {
"url": "https://s3.amazonaws.com/ddl-> "signature": "ce799d1c55fcf1985a02def4d85672ac86c022f8f7afefbe42b20364fba47d7a"
},
"mushroom": {
"url": "https://s3.amazonaws.com/ddl-> "signature": "f79fdbc33b012dabd06a8f3cb3007d244b6aab22d41358b9aeda74417c91f300"
},
"occupancy": {
"url": "https://s3.amazonaws.com/ddl-> "signature": "0b390387584586a05f45c7da610fdaaf8922c5954834f323ae349137394e6253"
},
"spam": {
"url": "https://s3.amazonaws.com/ddl-> "signature": "000309ac2b61090a3001de3e262a5f5319708bb42791c62d15a08a2f9f7cb30a"
},
"walking": {
"url": "https://s3.amazonaws.com/ddl-> "signature": "7a36615978bc3bb74a2e9d5de216815621bd37f6a42c65d3fc28b242b4d6e040"
},
"nfl": {
"url": "https://s3.amazonaws.com/ddl-> "signature": "4989c66818ea18217ee0fe3a59932b963bd65869928c14075a5c50366cb81e1f"
}
}

# 多行输出
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"

目录

相关文章