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 面向数据科学家的实用统计学
分类
|
151
准确率
(
precision
)
预测结果为
1
、真实值也为
1
的百分比(或比例)。
ROC
曲线
灵感度与特异性的绘图。
提升
(
lift
)
在不同截止概率的情况下,衡量模型在识别(相对罕见的)
1
上的有效性。
测量模型分类性能的一种简单方法是,计算预测正确的比例。
在大多数分类算法中,每个预测类都指定了一个“结果为
1
的估计概率”。
3
默认的决策点
或截止值一般采用
0.5
或
50%
。如果概率大于
0.5
,那么该情况就被分类为“
1
”;否则,
分类为“
0
”。另一种默认的截止值是使用数据中出现值为
1
的概率。
正确率只是一种对总体误差的度量:
(真阳性样本数
+
真阴性样本数)
样本总数
正确率
=
5.4.1
 混淆矩阵
混淆矩阵
是分类性能度量的关键所在。混淆矩阵是一种表格,其中显示了按响应类型分
类的正确预测数和错误预测数。
R
中有多个可以计算混淆矩阵的软件包,但是对于二元变
量,采用手动计算更便捷。
下面以
logistic_gam
模型为例介绍混淆矩阵。该模型是使用一个平衡数据集训练的,即其
中拖欠贷款和还清贷款的数量相同,如图
5-4
所示。遵循惯例,
Y
= 1
表示感兴趣的事件,
在本例中是拖欠贷款;
Y
= 0
表示负事件(或正常事件),在本例中是贷款还清。对于使用
整个训练集(即非平衡数据)训练得到的
logistic_gam
模型,下面的
R
代码计算了其混淆
矩阵。
pred <- predict(logistic_gam, newdata=train_set)
pred_y <- as.numeric(pred > 0)
true_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的智能文本分析

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

Python数据处理

Jacqueline Kazil, Katharine Jarmul
精通機器學習

精通機器學習

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

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

本贾尼 斯特劳斯特鲁普

Publisher Resources

ISBN: 9787115493668