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版)
234
7
PCA
的基本思想是将多个数值型预测变量组合成一个更小的变量集合,这个小集合是初始
集合的加权线性组合。这个更小的变量集合就称为
主成分
,可以“解释”完整变量集合中
的变异性,同时能够降低数据的维度。构建主成分时所使用的权重表明了初始变量对于新
的主成分的相对贡献。
PCA
方法最早是由卡尔
皮尔逊提出的。在一篇可能是最早的、关于无监督学习的论文
中,皮尔逊指出,在很多问题中预测变量具有变异性,所以提出了使用
PCA
方法作为对
变异性的建模技术。
PCA
可以看作线性判别分析的无监督版本,参见
5.2
节。
7.1.1
 一个简单的例子
对于两个变量
X
1
X
2
,有两个主成分
Z
i
i
=
1
2
):
,1 1 ,2 2ii i
Z wX wX= +
权重
,1 ,2
( , )
ii
ww
称为成分的
载荷
loading
,它们将初始变量转换为主成分。第一个主成分
Z
1
是能最好地解释全部变动的线性组合,第二个主成分
Z
2
与第一个主成分是正交的,它能最
好地解释剩余的变动。(如果还有其他主成分,那么每个主成分都与其他主成分是正交的。)
经常也使用预测变量的均值偏差代替它们本身的值来计算主成分。
R
中,可以使用
princomp
函数来计算主成分。下面的代码在雪佛龙公司(
CVX
)和埃
克森美孚公司(
XOM
)的股价收益上进行了一次
PCA
oil_px <- sp500_px[, c('CVX', 'XOM')]
pca <- princomp(oil_px)
pca$loadings
Loadings:
Comp.1 Comp.2
CVX ...
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