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版)
分类
173
逻辑回归是迄今为止最常见的
GLM
形式,不过数据科学家也会遇到其他类型的
GLM
。有
时候,会使用对数链接函数代替
logit
。实际上
,对大多数应用来说,使用对数链接函数
不太可能得到特别不同的结果。在对计数数据(如一定时间内某个用户访问某个网页的次
数)建模时,经常会使用泊松分布。还有一些分布族(包括负二项分布和伽马分布)常用
于对经过的时间(如失效时间)进行建模。与逻辑回归不同,使用这些模型的
GLM
的应
用更加复杂,需要更加谨慎。除非你对这些模型方法非常熟悉,清楚地了解它们的效用和
不足,否则应尽量避免使用。
5.3.4
 逻辑回归的预测值
逻辑回归的预测值是以对数发生比的形式表示的:
ˆ
Y
=
ln(Odds(
Y
=
1))
。通过逻辑响应函
数可以得到预测概率:
ˆ
1
ˆ
1e
Y
p
=
+
举个例子,看一下
R
logistic_model
模型的预测:
pred <- predict(logistic_model)
summary(pred)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-2.704774 -0.518825 -0.008539 0.002564 0.505061 3.509606
Python
中,可以将概率转换为数据框,并使用
describe
方法得到这些分布特性:
pred = pd.DataFrame(logit_reg.predict_log_proba(X),
columns=loan_data[outcome].cat.categories) ...
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