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版)
170
5
5.3.1
 逻辑响应函数和
logit
函数
逻辑回归的核心部分是
逻辑响应函数
logit
函数
,它们可以将一个概率(
0
1
之间)映
射到一个更加广阔的、适合线性建模的空间。
首先,不将结果变量看作一个二元标签,而是看作标签为“
1
”的概率
p
。我们可能想将
p
作为预测变量的一个线性函数进行建模:
0 11 2 2 qq
p xx x
ββ β β
= + + ++
但是,拟合这个模型不能保证
p
0
1
之间,而这是概率必须满足的条件。
所以,我们对预测变量使用一个
逻辑响应函数
(或者
logit
函数
),以此对
p
进行建模:
0 11 2 2
()
1
1e
qq
xx x
p
ββ β β
+ + ++
=
+
这种变换可以保证
p
始终在
0
1
之间。
为了去掉分母中的指数表达式,我们不使用概率,而是使用
发生比
odds
。赌徒们非常熟
悉发生比,它是“成功”(
1
)与
“不成功”(
0
)的比率。用概率术语来说,发生比就是某
件事情发生的概率除以它不发生的概率。例如,如果一匹马获胜的概率为
0.5
,那么它不
会获胜的概率就是(
1–0.5
=
0.5
,那么发生比就是
1.0
Odds( 1)
1
p
Y
p
= =
我们可以根据发生比的逆函数由发生比得到概率:
Odds
1 Odds
p =
+
将这个公式与前面的逻辑响应函数结合起来,就可以得到:
0 11 2 2
Odds( 1) e
qq
xx x
Y
ββ β β
+ + ++
= =
最后,对两边取对数,就可以得到一个由预测变量的线性函数所组成的表达式:
0 11 2 2
ln(Odds( 1))
qq
Y xx ...
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