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版)
分类
191
样记录的数量取决于过采样率,这个过采样率需要使数据集的结果类别达到大致平衡。
R
中有好几种
SMOTE
算法的实现
,最能全面处理非平衡数据的
R
包是
unbalanced
,其中
提供了各种各样的技术,包括一种可以选出最佳方法的“竞赛”算法。
SMOTE
算法特别
简单,在
R
中使用
FNN
包就能直接实现。
Python
中的
imbalanced-learn
包通过一个与
scikit-learn
兼容的
API
,实现了多种
SMOTE
算法
。它可以提供各种过采样和欠采样方法,并支持在提升和装袋分类器中使用
这些技术。
5.5.4
 基于成本的分类
实际上,准确率和
AUC
只是选择分类规则的一种基本方法。通常可以为假正例和假负例
估计出一个成本,在对
1
0
进行分类时
,通过考虑这些成本来确定最佳临界值是更合适
的一种做法。例如,假设一项新贷款违约的预期成本为
C
,而贷款还清的收益为
R
,那么
该贷款的预期收益就是:
预期收益
=
P
(
Y
=
0)
×
R
+
P
(
Y
=
1)
×
C
与其简单地将贷款标记为违约或还清,或者确定违约概率,还不如确定贷款的预期收益是
否为正。预测违约概率只是一个中间步骤,这个步骤必须与贷款总额结合起来,以确定它
的预期利润,这就是商业的最终规划指标。例如,即使一项大额贷款的预测违约概率稍
高,它的预期利润也高于一项小额贷款。
5.5.5
 探索预测结果
单一指标(如
AUC
)并不能对模型对具体情况的适应性做出全面的评价。图
5-8
给出了
四个不同模型的决策规则,这四个模型都是在贷款数据上拟合出来的,它们都只使用了
两个预测变量 ...
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