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版)
188
5
本节关键术语
欠采样
在分类模型中使用较少的普遍类记录。
同义词
下采样
过采样
在分类模型中使用较多的稀有类记录,如果有必要,可以进行
Bootstrap
抽样。
同义词
上采样
上加权和下加权
在模型的稀有(或普遍)类上添加更多(或更少)权重。
数据生成
Bootstrap
抽样类似,只是通过
Bootstrap
抽出的每个新记录都与它的来源有一点
儿差异。
z
分数
标准化后的结果值。
K
最近邻计算中使用的近邻数量。
5.5.1
 欠采样
如果你有足够多的数据,就像贷款数据一样,就可以对普遍类进行
欠采样
(或称下采样),
从而使得用于建模的数据在
0
1
之间更加平衡
。下采样的基本思想是多数类的数据中有
很多冗余记录。使用一个规模更小的、更加平衡的数据集可以令模型性能更佳,数据准
备、模型探索和试验也变得更加容易。
那么,多少数据才算“足够”呢?这取决于具体的应用,但一般来说,非普遍类中有几万
条记录就足够了。
1
0
之间的区分越容易,所需的数据就越少。
5.3
节中分析了贷款数据
,这个分析基于一个平衡的训练集:一半的贷款被还清,另一半
贷款则发生违约。预测值也一样:一半的概率小于
0.5
,另一半大于
0.5
。在完整的数据集
中,只有
19%
的贷款发生违约,如以下
R
代码所示:
mean(full_train_set$outcome=='default')
[1] 0.1889455
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