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 面向数据科学家的实用统计学
136
|
第
5
章
在标准的朴素贝叶斯算法中,预测因子必须是分类(因子)变量。
5.1.3
节将
介绍两种适用于连续变量的变通方法。
5.1.1
 准确的贝叶斯分类是不切实际的
如果预测变量超出一定的数量,那么很多待分类的记录就无法准确地匹配。为了解释这个
问题,下面我们以基于人口统计变量的投票预测模型为例。即使样本的规模相当大,很有
可能其中也不会包含能匹配下列条件的新记录:“来自美国中西部地区的西班牙裔男性美
国人,并且具有高收入,在上次选举中投了票,在之前的选举中没有投票,有
3
个女儿和
一个儿子,已经离婚。”在本例中只有
8
个变量,但是对于大多数分类问题而言,变量数
目远多于此。只是在
5
个同等频繁出现的类别中添加了一个新变量,就将匹配的概率降低
至原来的
20%
。
尽管我们称该方法为“朴素贝叶斯”,但不应将其当作一种贝叶斯统计方法。
朴素贝叶斯是一种数据驱动的经验性方法,仅需要具备一点点统计学专业知
识。它的名字源于与
贝叶斯规则
类似的且用于预测的计算方式,更详细地
说,就是在给定结果的情况下对预测值概率的初始计算,以及对结果概率的
最终计算。
5.1.2
 朴素解决方案
在朴素贝叶斯解决方案中,我们不再将概率计算局限于那些匹配待分类记录的记录上,而
是使用整个数据集。朴素贝叶斯的改进如下。
(1)
对于二元响应变量
Y
=
i
(
i
= 0
或
1
),估计每个预测因子的条件概率
P
(
X
j
|
Y
=
i
)
。这些
是当观测到
Y
=
i
时,预测因子值在记录中的概率。概率估计值为训练集中
Y
=
i
的记录
中
X
j
值的比例。
(2)
将这些概率相乘,再乘以属于 ...
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