Skip to Content
Python文本分析
book

Python文本分析

by Jens Albrecht, Sidharth Ramachandran, Christian Winkler
August 2022
Intermediate to advanced
441 pages
11h 26m
Chinese
China Electric Power Press Ltd.
Content preview from Python文本分析
226
|
第
7
章
ELI5
仍在开发中
目前
ELI5
仍在积极的开发中,
scikit-learn
新版本的使用可能会遇到问题。
在本章中,我们使用了
ELI5 0.10.1
版。
ELI5
是一个非常易于使用的软件库,可用于理解和可视化分类器的决策逻辑,但是
它也无法避免底层
LIME
算法的缺点,例如只能通过样本进行解释。为了使黑盒分
类更加透明,我们需要窥探模型内部使用的“规则”。华盛顿大学团队为此创建了
一个名叫
Anchor
的项目。
7.6
案例:使用
Anchor
解释分类结果
与
LIME
同样,
Anchor
(
https://oreil.ly/qSDMl
)也不依赖模型,而且可
用于解释任何黑盒模型。作为一个解释工具,
Anchor
创建了很多规则,
也就是“
anchor
”,这些
anchor
可以解释模型的行为。阅读这些规则,不仅能够解
释模型的预测,而且还可以按照模型学习到的方式来进行预测。
与
LIME
相比,
Anchor
具有非常大的优势,它可以更好地通过规则解释模型。但是,
该软件本身非常新,而且仍在开发中。并非所有示例都适合我们,因此我们选择了
一些有助于解释分类模型的方法。
7.6.1
使用遮盖后的单词分布
Anchor
有多种使用方法。首先我们从“
unknown
”(未知)分布开始。
Anchor
可以
通过将对预测没有太大影响的单词替换成“
unknown
”的方式,对模型做出的决策
进行解释。
下面,我们继续以
ID
为
21
的文档为例进行说明。在这个示例中,分类器遇到的困
难在于,它需要从两个类别之间进行选择,但这两个类别的概率非常接近。这是一 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

工程战略的制定

工程战略的制定

Will Larson
Python实用技能学习指南

Python实用技能学习指南

Posts & Telecom Press, Robert Smallshire, Austin Bingham
精益AI

精益AI

Lomit Patel
Excel金融建模

Excel金融建模

Posts & Telecom Press, Shmuel Oluwa

Publisher Resources

ISBN: 9787519864446