Skip to Content
数据科学中的实用统计学(第2版)
book

数据科学中的实用统计学(第2版)

by Peter Bruce, Andrew Bruce, Peter Gedeck
October 2021
Intermediate to advanced
289 pages
8h 31m
Chinese
Posts & Telecom Press
Content preview from 数据科学中的实用统计学(第2版)
分类
161
1.
找出和它具有同样预测变量(即预测变量的值相同)的所有其他记录;
2.
确定这些记录属于哪些类别,以及哪个类别是最普遍的(即最可能的)
3.
将这个类别分配给这条新记录。
上面的方法就是找出样本中所有与待分类记录完全相似的记录。完全相似是指它们的所有
预测变量值都相同。
在标准的朴素贝叶斯算法中,预测变量必须是分类变量(因子)。
5.1.3
节给
出了两种使用连续型变量的变通方法。
5.1.1
 为什么进行精确贝叶斯分类是不现实的
如果预测变量超出了一定的数量,很多待分类记录就不能精确匹配。来看一个在人口统计
变量的基础上预测投票的模型。对于一位拉美裔、高收入、来自美国中西部、在上一次选
举中投了票、在前一次选举中没有投票、有三个女儿和一个儿子的离异男性来说,即使在
一个非常大的样本中也可能找不到一个与其完全匹配的记录。这个例子中只有
8
个变量
对于多数分类问题而言这个数量非常少。如果再加上一个有
5
个等频类别的新变量
,那么
匹配的概率就会降低到原来的五分之一。
5.1.2
 朴素贝叶斯问题求解
在朴素贝叶斯问题的求解中,不再将概率计算限制在那些与待分类记录匹配的记录中,而
是使用整个数据集。修正后的朴素贝叶斯算法如下。
1.
对于一个二元响应变量
Y
=
i
i
=
0
1
,为每个预测变量估计出独立的条件概率
P
(
X
j
|
Y
=
i
)
;这是在观测到
Y
=
i
时,预测变量值在该记录中的概率。这个概率是使用训
练集中
Y
=
i
的记录中
X
j
值的比例估计出的。
2.
将这些概率相乘,再乘以属于
Y
=
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机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu

Publisher Resources

ISBN: 9787115569028