Skip to Content
面向数据科学家的实用统计学
book

面向数据科学家的实用统计学

by Peter Bruce, Andrew Bruce
October 2018
Beginner to intermediate
238 pages
6h 32m
Chinese
Posts & Telecom Press
Content preview from 面向数据科学家的实用统计学
174
|
第
6
章
树模型不仅可以做出值为“
0
”或“
1
”的二元预测,还可以根据分区中的
“
0
”和“
1
”的数量产生一个概率估计值。概率估计值是分区中“
0
”或“
1
”
的总个数,除以分区中观测值的总个数。
概率
(
Y
= 1) =
分区中“
1
”的个数
/
分区大小
Y
= 1
的概率估计值可以转换为二元决策。例如,如果概率估计值大于
0.5
,
那么可以设估计值为
1
。
6.2.3
 测量同质性或不纯度
树模型递归地创建分区(记录的集合),并给出
Y =
0
或
Y
= 1
的预测结果。从上节介绍的
递归算法中可以看到,我们还需要一种测量分区同质性(也称为
类纯度
)的方法。或者也
可以说,我们需要测量分区的不纯度。预测的正确率是分区内误分类记录的比例
p
。
p
的
取值介于
0
(即完美分区)和
0.5
(即纯随机猜测)之间。
事实证明,对于不纯度来说,正确率并非一种很好的度量。两种常用的不纯度度量分别是
基尼不纯度
和
熵
(或
信息
)。虽然这些不纯度度量及其他一些度量适用于多分类(即两个
以上的类)问题,在此我们只介绍二元的情况。一组记录
A
的基尼不纯度
I
(
A
)
定义为:
I
(
A
) =
p
(1
-
p
)
熵
I
(
A
)
由下式给出:
I
(
A
) =
-
p
log
2
(
p
)
-
(1
-
p
) log
2
(1
-
p
)
图
6-5
显示了基尼不纯度(经过重新缩放的)与熵度量是相似的,在中等正确率和高正确
率的情况下,熵会给出较高的不纯度分值。
正确率
熵
基尼不纯度
不纯度
p
图 6-5:基尼不纯度和熵度量
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

基于Python的智能文本分析

基于Python的智能文本分析

Benjamin Bengfort, Rebecca Bilbro, Tony Ojeda
Python数据处理

Python数据处理

Jacqueline Kazil, Katharine Jarmul
精通機器學習

精通機器學習

Aurélien Géron
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普

Publisher Resources

ISBN: 9787115493668