主成分分析

From Ufldl

Jump to: navigation, search
(PCA on Images 对图像数据应用PCA算法)
(Example and Mathematical Background 实例和数学背景)
Line 37: Line 37:
【二审】:假设你使用图像来训练算法,那么输入数据是有一定冗余的,因为图像中相连的像素是强相关的。具体来说,假如我们正在训练的16x16灰度值图像,那么<math>\textstyle x \in \Re^{256}</math>是个256维向量,其中,特征值<math>\textstyle x_j</math>对应每个像素的亮度值。因为相连像素间具有相关性,PCA算法可以将输入向量转换为一个维数低很多的近似向量,并仅产生极小的误差。
【二审】:假设你使用图像来训练算法,那么输入数据是有一定冗余的,因为图像中相连的像素是强相关的。具体来说,假如我们正在训练的16x16灰度值图像,那么<math>\textstyle x \in \Re^{256}</math>是个256维向量,其中,特征值<math>\textstyle x_j</math>对应每个像素的亮度值。因为相连像素间具有相关性,PCA算法可以将输入向量转换为一个维数低很多的近似向量,并仅产生极小的误差。
 +
== Example and Mathematical Background 实例和数学背景 ==
== Example and Mathematical Background 实例和数学背景 ==
Line 102: Line 103:
【二审】:也就是说,<math>\textstyle u_1</math>方向上的数据要比<math>\textstyle u_2</math>方向的变化大。为更正式地计算出方向<math>\textstyle u_1</math>和<math>\textstyle u_2</math>,我们首先计算出矩阵<math>\textstyle \Sigma</math>,如下所示:
【二审】:也就是说,<math>\textstyle u_1</math>方向上的数据要比<math>\textstyle u_2</math>方向的变化大。为更正式地计算出方向<math>\textstyle u_1</math>和<math>\textstyle u_2</math>,我们首先计算出矩阵<math>\textstyle \Sigma</math>,如下所示:
-
 
:<math>\begin{align}
:<math>\begin{align}
Line 147: Line 147:
【二审】:你可以通过标准的线性代数运算软件求得特征向量(见实现说明),在此,让我们计算出协方差矩阵<math>\textstyle \Sigma</math>的特征向量值,并按列排放,组成矩阵<math>\textstyle U</math>:
【二审】:你可以通过标准的线性代数运算软件求得特征向量(见实现说明),在此,让我们计算出协方差矩阵<math>\textstyle \Sigma</math>的特征向量值,并按列排放,组成矩阵<math>\textstyle U</math>:
-
 
:<math>\begin{align}
:<math>\begin{align}
Line 181: Line 180:
【二审】:在我们的示例中,向量<math>\textstyle u_1</math>和<math>\textstyle u_2</math>构成了一个表示数据的新的基。令<math>\textstyle x \in \Re^2</math>为训练样本,那么<math>\textstyle u_1^Tx</math>就是样本点<math>\textstyle x</math>在维度<math>\textstyle u_1</math>上的投影长度(幅值)。同样的,<math>\textstyle u_2^Tx</math>是<math>\textstyle x</math>投影到<math>\textstyle u_2</math>维度上的幅值。
【二审】:在我们的示例中,向量<math>\textstyle u_1</math>和<math>\textstyle u_2</math>构成了一个表示数据的新的基。令<math>\textstyle x \in \Re^2</math>为训练样本,那么<math>\textstyle u_1^Tx</math>就是样本点<math>\textstyle x</math>在维度<math>\textstyle u_1</math>上的投影长度(幅值)。同样的,<math>\textstyle u_2^Tx</math>是<math>\textstyle x</math>投影到<math>\textstyle u_2</math>维度上的幅值。
-
 
== Rotating the Data 旋转数据 ==
== Rotating the Data 旋转数据 ==

Revision as of 23:54, 11 March 2013

Personal tools