主成分分析

From Ufldl

Jump to: navigation, search
(Recovering an Approximation of the Data 数据还原)
Line 449: Line 449:
【一审】:现在,<math>\textstyle \tilde{x} \in \Re^k</math>成为<math>\textstyle x \in \Re^n</math>在低维空间的一个“压缩”表征。 反过来,如果给定<math>\textstyle \tilde{x}</math>,我们应如何尽可能地还原原始数据<math>\textstyle \hat{x}</math>呢?由本章第三节可知<math>\textstyle x = U x_{\rm rot}</math>,且<math>\textstyle \tilde{x}</math>可以看作<math>\textstyle x_{\rm rot}</math>的近似值,因为<math>\textstyle \tilde{x}</math>只是将<math>\textstyle x_{\rm rot}</math>最后的<math>\textstyle n-k</math>个元素用0代替并省略而得到,因此如果给定<math>\textstyle \tilde{x} \in \Re^k</math>,可以通过在其末尾添加<math>\textstyle n-k</math>个0来得到<math>\textstyle x_{\rm rot} \in \Re^n</math>的近似,接着用<math>\textstyle U</math>左乘该<math>\textstyle x_{\rm rot}</math>近似值便可得到对原数据<math>\textstyle x</math>的近似还原。具体来说,我们需进行如下计算:
【一审】:现在,<math>\textstyle \tilde{x} \in \Re^k</math>成为<math>\textstyle x \in \Re^n</math>在低维空间的一个“压缩”表征。 反过来,如果给定<math>\textstyle \tilde{x}</math>,我们应如何尽可能地还原原始数据<math>\textstyle \hat{x}</math>呢?由本章第三节可知<math>\textstyle x = U x_{\rm rot}</math>,且<math>\textstyle \tilde{x}</math>可以看作<math>\textstyle x_{\rm rot}</math>的近似值,因为<math>\textstyle \tilde{x}</math>只是将<math>\textstyle x_{\rm rot}</math>最后的<math>\textstyle n-k</math>个元素用0代替并省略而得到,因此如果给定<math>\textstyle \tilde{x} \in \Re^k</math>,可以通过在其末尾添加<math>\textstyle n-k</math>个0来得到<math>\textstyle x_{\rm rot} \in \Re^n</math>的近似,接着用<math>\textstyle U</math>左乘该<math>\textstyle x_{\rm rot}</math>近似值便可得到对原数据<math>\textstyle x</math>的近似还原。具体来说,我们需进行如下计算:
-
【二审】:
+
【二审】:现在,我们得到了原始数据<math>\textstyle x \in \Re^n</math>的低维“压缩”表征量<math>\textstyle \tilde{x} \in \Re^k</math>, 反过来,如果给定<math>\textstyle \tilde{x}</math>,我们应如何还原原始数据<math>\textstyle \hat{x}</math>呢?查看以往章节可知<math>\textstyle x = U x_{\rm rot}</math>,且可把<math>\textstyle \tilde{x}</math>看作将<math>\textstyle x_{\rm rot}</math>的最后<math>\textstyle n-k</math>个元素置0所得的近似值,因此如果给定<math>\textstyle \tilde{x} \in \Re^k</math>,可以通过在其末尾添加<math>\textstyle n-k</math>个0来得到<math>\textstyle x_{\rm rot} \in \Re^n</math>的近似,最后,左乘<math>\textstyle U</math>便可得原数据<math>\textstyle x</math>的近似。具体来说,计算如下:
-
 
+
:<math>\begin{align}
:<math>\begin{align}
Line 456: Line 455:
= \sum_{i=1}^k u_i \tilde{x}_i.
= \sum_{i=1}^k u_i \tilde{x}_i.
\end{align}</math>
\end{align}</math>
-
 
【原文】:The final equality above comes from the definition of <math>\textstyle U</math> [[#Example and Mathematical Background|given earlier]].
【原文】:The final equality above comes from the definition of <math>\textstyle U</math> [[#Example and Mathematical Background|given earlier]].
Line 468: Line 466:
【一审】:上面的等式来源于先前对<math>\textstyle U</math>的定义,(在实际应用时,我们不倾向于先给<math>\textstyle \tilde{x}</math>填0然后再左乘<math>\textstyle U</math>,因为这样意味着大量的乘0运算,相反我们选择用<math>\textstyle U</math>的前<math>\textstyle k</math>列来乘<math>\textstyle \tilde{x} \in \Re^k</math>,其结果也即等于上面式子中最右边项。)将该算法应用到本章节的样例数据集,我们可以得到以下关于<math>\textstyle \hat{x}</math>的图示:
【一审】:上面的等式来源于先前对<math>\textstyle U</math>的定义,(在实际应用时,我们不倾向于先给<math>\textstyle \tilde{x}</math>填0然后再左乘<math>\textstyle U</math>,因为这样意味着大量的乘0运算,相反我们选择用<math>\textstyle U</math>的前<math>\textstyle k</math>列来乘<math>\textstyle \tilde{x} \in \Re^k</math>,其结果也即等于上面式子中最右边项。)将该算法应用到本章节的样例数据集,我们可以得到以下关于<math>\textstyle \hat{x}</math>的图示:
-
【二审】:
+
【二审】:上面的等式来源于先前对<math>\textstyle U</math>的定义,(在实际应用时,我们不倾向于先给<math>\textstyle \tilde{x}</math>填0然后再左乘<math>\textstyle U</math>,因为这意味着大量的乘0运算,相反我们选择用<math>\textstyle \tilde{x} \in \Re^k</math>的前<math>\textstyle k</math>列来乘<math>\textstyle U</math>,即上式中最右项。)将该算法应用于本例中的数据集,我们可得如下关于 <math>\textstyle \hat{x}</math>的图示:
Line 485: Line 483:
【初译】:由图可看出我们实际上得到的是对原始数据的一维近似。
【初译】:由图可看出我们实际上得到的是对原始数据的一维近似。
 +
如果要训练一个自动编码器(autoencoder)或其它无监督特征学习算法,运算时间将直接依赖于输入数据的维数。若用<math>\textstyle \tilde{x} \in \Re^k</math>取代<math>\textstyle x</math>作为输入数据,那么算法将使用该低维数据进行训练,运行速度也大大加快。对于很多数据集来说,低维表征量<math>\textstyle \tilde{x}</math>都可达到对原数据集的完美近似,因此对这些数据集使用PCA算法将可保证在只产生较小近似误差的同时极大地提速程序。
如果要训练一个自动编码器(autoencoder)或其它无监督特征学习算法,运算时间将直接依赖于输入数据的维数。若用<math>\textstyle \tilde{x} \in \Re^k</math>取代<math>\textstyle x</math>作为输入数据,那么算法将使用该低维数据进行训练,运行速度也大大加快。对于很多数据集来说,低维表征量<math>\textstyle \tilde{x}</math>都可达到对原数据集的完美近似,因此对这些数据集使用PCA算法将可保证在只产生较小近似误差的同时极大地提速程序。
【一审】:由上图可看出我们实际上得到的是对原始数据的一维近似。
【一审】:由上图可看出我们实际上得到的是对原始数据的一维近似。
 +
如果要训练一个自动编码器(autoencoder)或其它无监督特征学习算法,运算时间将直接依赖于输入数据的维度数。若用<math>\textstyle \tilde{x} \in \Re^k</math>取代<math>\textstyle x</math>作为输入数据,那么算法将使用该低维数据进行训练,运行速度也大大加快。对于很多数据集来说,低维表征量<math>\textstyle \tilde{x}</math>都可达到对原数据集的完美近似,因此对这些数据集使用PCA算法将可保证在只产生较小近似误差的同时极大地提速程序。
如果要训练一个自动编码器(autoencoder)或其它无监督特征学习算法,运算时间将直接依赖于输入数据的维度数。若用<math>\textstyle \tilde{x} \in \Re^k</math>取代<math>\textstyle x</math>作为输入数据,那么算法将使用该低维数据进行训练,运行速度也大大加快。对于很多数据集来说,低维表征量<math>\textstyle \tilde{x}</math>都可达到对原数据集的完美近似,因此对这些数据集使用PCA算法将可保证在只产生较小近似误差的同时极大地提速程序。
-
【二审】:
+
【二审】:由图可知我们得到的是对原始数据集的一维近似。
 +
 
 +
如果要训练一个自动编码器或其它无监督特征学习算法,算法运行时间将依赖于输入数据的维数。若用<math>\textstyle \tilde{x} \in \Re^k</math>取代<math>\textstyle x</math>作为输入数据,那么算法将使用低维数据进行训练,运行速度将显著加快。对于很多数据集来说,低维表征量<math>\textstyle \tilde{x}</math>即为原数据集的极佳近似,如此使用PCA算法可在只产生极小近似误差的同时,显著地提高运行速度。
== Number of components to retain 选择主成分个数 ==
== Number of components to retain 选择主成分个数 ==

Revision as of 23:27, 11 March 2013

Personal tools