PCA 和 SVD

部署运行你感兴趣的模型镜像

Quick Summary of PCA:

1. Organize data as an m*n matrix, where m is the number of measurement types and n is the number of samples

2.Subtract off the mean for each measurement type

3. Calculate the SVD or the eigenvectors of the covariance


A deeper appreciation of the limits of PCA requires some consideration about the underlying assumptions and in tandem, a more rigorous description of the source of data. Generally speaking, the primary motivation behind this method is to decorrelate the data set, i.e. remove second-order depencies.


In the context of dimensional reduction, one measure of success is the degree to which a reduced representation can predict the original data. In statistical terms, we must define the error function(or loss function). It can be proved that under a common loss function, mean squared error(i.e. L2 norm), PCA provides the optimal reduced representation of the data. The means that selecting orthogonal directions for principal component is the best solution to predicting the original data.


The goal of the analysis is to decorrelate the data, or said in other terms, the goal is to remove second-order dependencies exist between the variables.


Multiple solutions exist for removing higher-order dependencies. For instance, if prior knowledge is known about the problem, then a nonlinearity might be applied to the data to transform the data to a more appropriate naive basis.


Another direction is to impose more general statistical definitions of dependency within a data, e.g. requiring that data along reduced dimensions be statistically independent. This class of algorithm, termed, independent component analysis(ICA), has been to demonstrated to succeed in many domains where PCA fails.

您可能感兴趣的与本文相关的镜像

PyTorch 2.6

PyTorch 2.6

PyTorch
Cuda

PyTorch 是一个开源的 Python 机器学习库,基于 Torch 库,底层由 C++ 实现,应用于人工智能领域,如计算机视觉和自然语言处理

### 主成分分析 (PCA) 奇异值分解 (SVD) #### PCA 的工作原理及其应用 主成分分析是一种用于降维的技术,其目标是在保留尽可能多的信息的同时减少数据集的维度。通过计算协方差矩阵并找到最大化的方向向量(即主成分),可以实现这一点。每个主成分对应于原始变量的一个线性组合,并按照它们所解释的数据总变异的比例排序。 对于给定的数据集,`explained_variance_ratio_` 属性提供了各主成分对方差贡献的具体数值[^1]: ```python import numpy as np from sklearn.decomposition import PCA np.set_printoptions(precision=3, suppress=True) pca = PCA() # 计算 explained variance ratio... print(pca.explained_variance_ratio_) ``` 这种方法特别适用于可视化高维数据、去除噪声或作为其他机器学习模型之前的预处理步骤。 #### SVD 的工作机制及其用途 奇异值分解则提供了一种不同的视角来看待相同的问题——它不是直接寻找最佳投影轴,而是将输入矩阵 \( A \in R^{m\times n} \) 分解成三个部分:两个正交矩阵 U V 转置以及中间对角阵 Σ 。其中Σ包含了所谓的“奇异值”,反映了原矩阵的重要程度;而UV分别代表左奇异性向量与右奇异性向量。 这种技术同样能够帮助我们理解复杂结构化信息的本质特征[^3]。例如,在图像压缩场景下,可以通过截断较小的奇异值得到近似版本从而节省存储空间而不明显影响质量。 #### PCASVD 的对比 尽管两者都涉及到降低维度的概念,但存在一些关键差异: - **目的不同**: PCA旨在最大化样本间的距离度量标准下的离散度;相比之下,SVD关注的是重构误差最小化. - **适用范围各异**: 当仅需考虑单个表征时可选用前者; 若涉及多个关联表格,则后者更为合适. - **输出形式有所区别**: 经过PCA变换后的坐标系通常具有直观的意义(如第一主元往往指示着最重要的变化趋势);然而经由SVD得到的结果可能缺乏类似的解释力除非进一步转换为特定上下文内的含义.
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值