Skip to Content
机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
book

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

by Aurélien Géron
October 2020
Intermediate to advanced
693 pages
16h 26m
Chinese
China Machine Press
Content preview from 机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
198
|
第
8
章
但是,这种隐含假设并不总是成立。例如,在图 8-6 的下面一行中,决策边界位于
x
1
= 5
处。此决策边界在原始 3D 空间(垂直平面)中看起来非常简单,但在展开流形中看起来
更加复杂(四个独立线段的集合)。
简而言之,在训练模型之前降低训练集的维度肯定可以加快训练速度,但这并不总是会
导致更好或更简单的解决方案,它取决于数据集。
希望现在你对于维度的诅咒有了一个很好的理解,也知道降维算法是怎么解决它的,
特别是当流形假设成立的时候应该怎么处理。本章剩余部分将逐一介绍几个最流行的
算法。
8.3 PCA
主成分分析(PCA)是迄今为止最流行的降维算法。首先,它识别最靠近数据的超平面,
然后将数据投影到其上,如图 8-2 所示。
8.3.1 保留差异性
将训练集投影到低维超平面之前需要选择正确的超平面。例如图 8-7 的左图代表一个简
单的 2D 数据集,沿三条不同的轴(即一维超平面)。右图是将数据集映射到每条轴上的
结果。正如你所见,在实线上的投影保留了最大的差异性,而点线上的投影只保留了非
常小的差异性,虚线上的投影的差异性居中。
图 8-7:选择要投影的子空间
选择保留最大差异性的轴看起来比较合理,因为它可能比其他两种投影丢失的信息更
少。要证明这一选择,还有一种方法,即比较原始数据集与其轴上的投影之间的均方距
离,使这个均方距离最小的轴是最合理的选择,也就是实线代表的轴。这也正是 PCA
降维
|
199
背后的简单思想
注 4
。
1
8.3.2 主要成分
主成分分析可以在训练集中识别出哪条轴对差异性的贡献度最高。在图 ...
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

算法技术手册(原书第2 版)

算法技术手册(原书第2 版)

George T.Heineman, Gary Pollice, Stanley Selkow
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787111665977