pca 主成分分析

TL;DR: PCA cannot handle categorical variables because it makes linear assumptions about them. Nonlinear PCA addresses this issue by warping the feature space to optimize explained variance. (Key points at bottom.)

TL; DR: PCA无法处理分类变量,因为它对它们进行了线性假设。 非线性PCA通过扭曲特征空间以优化解释的方差来解决此问题。 (关键点在底部。)

Principal Component Analysis (PCA) has been one of the most powerful unsupervised learning techniques in machine learning. Given multi-dimensional data, PCA will find a reduced number of n uncorrelated (orthogonal) dimensions, attempting to retain as much variance in the original dataset as possible. It does this by constructing new features (principle components) as linear combinations of existing columns.

主成分分析(PCA)是机器学习中最强大的无监督学习技术之一。 给定多维数据,PCA将发现数量减少的n个不相关(正交)维,尝试在原始数据集中保留尽可能多的方差。 它通过将新功能(原理组件)构造为现有列的线性组合来实现。

However, PCA cannot handle nominal — categorical, like state — or ordinal — categorical and sequential, like letter grades (A+, B-, C, …) — columns. This is because a metric like variance, which PCA explicitly attempts to model, is an inherently numerical measure. If one were to use PCA on data with nominal and ordinal columns, it would end up making silly assumptions like ‘California is one-half New Jersey’ or ‘A+ minus four equals D’, since it must make those kinds of relationships to operate.

但是,PCA无法处理名义(类别,如状态)或排序(类别和顺序),如字母等级(A +,B-,C等)的列。 这是因为PCA明确尝试建模的类似方差的度量标准是固有的数字度量。 如果要在具有标称和序数列的数据上使用PCA,最终将做出愚蠢的假设,例如“加利福尼亚州是新泽西州的一半”或“ A +减去四等于D”,因为它必须使这种关系起作用。

Rephrased in relation to a mathematical perspective, PCA relies on linear relationships, that is, the assumption that the distance between “strongly disagree” and “disagree” is the same as the difference from “disagree” to “neutral”. In almost every real-world dataset, these sorts of linear relationships do not exist for all columns.

从数学角度重新描述,PCA依赖于线性关系,即“强烈不同意”和“不同意”之间的距离与“不同意”到“中立”的差异相同的假设。 在几乎每个现实世界的数据集中,并非所有列都存在此类线性关系。

Additionally, using one-hot encoding — that is, converting categorical data into vectors of ones and zeroes — results in an extremely sparse and information-parched multidimensional space that PCA cannot perform well on, since several features contain only two unique values.

此外,使用一键编码(即将分类数据转换为一和零的向量)会导致PCA无法很好地执行的极为稀疏且信息匮乏的多维空间,因为多个功能仅包含两个唯一值。

Nonlinear PCA rectifies this aspect of PCA by generalizing methods to approach dimensionality reduction not only for numerical features, but for categorical and ordinal variables. This is done through categorical quantification.

非线性PCA通过泛化方法来修正PCA的这一方面,不仅针对数字特征,而且针对分类和有序变量也都采用降维方法。 这是通过分类量化完成的。

Categorical quantification (CQ) is exactly what its name suggests: it attaches a numerical representation to each category, converting categorical columns into numerical ones, such that the performance of the PCA model (like explained variance) is maximized. CQ optimally places categories on a numerical dimension instead of making assumptions about them.

分类量化(CQ)正是其名称的含义:它将数字表示形式附加到每个类别,将分类列转换为数字列,从而使PCA模型的性能(如解释的方差)最大化。 CQ最佳地将类别放在数字维度上,而不是对其进行假设。

This information can be very enriching. For instance, we might be able to say that Washington and Idaho have very similar structures in other parts of the data because they are placed so closely, or that California and Virginia are nowhere similar because they are placed far apart. In this sense, CQ is not only enriching the PCA model with categorical data but also giving us a look into the structures of the data by state.

这些信息可以非常丰富。 例如,我们也许可以说,华盛顿和爱达荷州在数据的其他部分具有非常相似的结构,因为它们放置得太近了;或者,加利福尼亚和弗吉尼亚州的相似之处在于它们的位置很远。 从这个意义上讲,CQ不仅用分类数据丰富了PCA模型,而且使我们可以按状态查看数据的结构。

An alternative view of CQ is through a line plot. Although in the case of nominal data, the order of columns is arbitrary and there do not need to be connecting lines, it is visualized in this way to demonstrate the nominal level of analysis. If a feature’s level is specified as nominal, it can take on any numerical value.

CQ的替代视图是通过折线图。 尽管在名义数据的情况下,列的顺序是任意的,并且不需要连接线,但可以通过这种方式将其可视化以展示名义分析水平。 如果将特征级别指定为标称值,则它可以采用任何数值。

On the other hand, if a feature level is specified as ordinal, the restriction is that the order must be preserved. For instance, the relation between ‘A’ and ‘B’ in that ‘A’ is better than ‘B’ must be kept, which can be represented with A=0 and B=5 (assuming 0 is the best) or A=25 and B=26, as long as B is never less than A. This helps retain the structure of ordinal data.

另一方面,如果将要素级别指定为序数,则限制是必须保留顺序。 例如,必须保持“ A”与“ B”之间的关系,因为“ A”优于“ B”,可以用A=0B=5 (假设0为最佳)或A=25B=26 ,只要B永远不小于A。这有助于保留序数数据的结构。

Note that the next data point is always larger or equal to the previous data point. This is a restriction on ordinal-level features.
请注意,下一个数据点始终大于或等于前一个数据点。 这是对序数级功能的限制。

Like CQ for nominal data, this is tremendously insightful. For instance, we notice that within pluses and minuses of letter grades (A+, A, A-), there is not much difference, but the difference between X- and Y+ (X and Y being sequential letters) always leads to a large jump, particularly the difference between D and F. To reiterate the point above — this chart is generated by finding optimal values for categories such that the PCA model performs best (explained variance is highest).

就像名义数据的CQ一样,这是非常有见地的。 例如,我们注意到在字母等级(A +,A,A-)的正负之间并没有太大差异,但是X-Y +之间的差异( XY是顺序字母)总是导致重申以上几点-通过查找类别的最佳值以使PCA模型表现最佳(解释方差最高)来生成此图。

Note that because CQ determines the space between data points (e.g. that the difference between A and A- is much less than that of D and F), it warps the space in which these points lie. Instead of assuming a linear relationship (A and A- are as close as D and F), CQ distorts the distances between common intervals — hence, nonlinear PCA.

请注意,由于CQ决定了数据点之间的间隔(例如,A和A-之间的差远小于D和F的差),因此它将扭曲这些点所在的空间。 CQ不会假设线性关系(A和A-与D和F接近),而是会扭曲公共间隔之间的距离,因此会扭曲非线性 PCA。

To give an idea of the nonlinearities that can arise when the distance between sequential intervals are altered, here’s a 3 by 3 square in distorted space:

为了让人们理解当顺序间隔之间的距离改变时可能出现的非线性,这里是一个3 x 3平方的扭曲空间:

By using categorical quantification, the feature space is distorted — in a good way! Intervals are selectively chosen such that the performance of PCA is maximized. Nonlinear PCA, in this sense, not only can be thought of as an encoding method for ordinal and nominal variables but also increases the global strength of the PCA model.

通过使用分类定量,可以很好地扭曲特征空间! 选择间隔以使PCA的性能最大化。 从这个意义上讲,非线性PCA不仅可以看作是序数和名义变量的编码方法,而且可以提高PCA模型的整体强度。

Although the mathematics behind Nonlinear PCA is very rich, generally speaking, NPCA uses the same methods as PCA (like eigenvalue solving, etc.), but uses CQ to derive the most information and benefit to the model.

尽管非线性PCA背后的数学非常丰富,但通常来说,NPCA使用与PCA相同的方法(例如特征值求解等),但是使用CQ来获得最多的信息并从模型中受益。

关键点 (Key Points)

  • PCA cannot handle nominal (categorical) or ordinal (sequential) columns because it is an inherently numerical algorithm and makes silly linear assumptions about these types of data.PCA无法处理标称(分类)或序数(顺序)列,因为它是固有的数值算法,并且对这些类型的数据进行了愚蠢的线性假设。
  • Nonlinear PCA uses categorical quantification, which finds the best numerical representation of unique column values such that the performance (explained variance) of the PCA model using the transformed columns is optimized.非线性PCA使用分类量化,它可以找到唯一列值的最佳数值表示形式,从而可以优化使用转换列的PCA模型的性能(解释方差)。
  • Categorical quantification is a very insightful data mining method, and can give lots of insight into the structures of the data through the lens of a categorical value. Unfortunately, using Nonlinear PCA means that the coefficients of principal components are less interpretable (but still understandable, just to a less statistical rigor).分类量化是一种非常有见地的数据挖掘方法,可以通过分类价值的镜头深入了解数据的结构。 不幸的是,使用非线性PCA意味着主成分的系数难以解释(但仍然可以理解,只是对统计的严格要求较低)。

All images created by author.

作者创作的所有图像。

翻译自: https://medium.com/analytics-vidhya/beyond-ordinary-pca-nonlinear-principal-component-analysis-54a93915a702

pca 主成分分析


http://www.taodudu.cc/news/show-863494.html

相关文章:

  • 全局变量和局部变量命名规则_变量范围和LEGB规则
  • dask 使用_在Google Cloud上使用Dask进行可扩展的机器学习
  • 计算机视觉课_计算机视觉教程—第4课
  • 用camelot读取表格_如何使用Camelot从PDF提取表格
  • c盘扩展卷功能只能向右扩展_信用风险管理:功能扩展和选择
  • 使用OpenCV,Keras和Tensorflow构建Covid19掩模检测器
  • 使用Python和OpenCV创建自己的“ CamScanner”
  • cnn图像进行预测_CNN方法:使用聚合物图像预测其玻璃化转变温度
  • 透过性别看世界_透过树林看森林
  • gan神经网络_神经联觉:当艺术遇见GAN
  • rasa聊天机器人_Rasa-X是持续改进聊天机器人的独特方法
  • python进阶指南_Python特性工程动手指南
  • 人工智能对金融世界的改变_人工智能革命正在改变网络世界
  • 数据科学自动化_数据科学会自动化吗?
  • 数据结构栈和队列_使您的列表更上一层楼:链接列表和队列数据结构
  • 轨迹预测演变(第1/2部分)
  • 人口预测和阻尼-增长模型_使用分类模型预测利率-第3部分
  • 机器学习 深度学习 ai_人工智能,机器学习,深度学习-特征和差异
  • 随机模拟_随机模拟可帮助您掌握统计概念
  • 机器学习算法如何应用于控制_将机器学习算法应用于NBA MVP数据
  • 知乎 开源机器学习_使用开源数据和机器学习预测海洋温度
  • :)xception_Xception:认识Xtreme盗梦空间
  • 评估模型如何建立_建立和评估分类ML模型
  • 介绍神经网络_神经网络介绍
  • 人物肖像速写_深度视频肖像
  • 奇异值值分解。svd_推荐系统-奇异值分解(SVD)和截断SVD
  • 机器学习 对模型进行惩罚_使用Streamlit对机器学习模型进行原型制作
  • 神经网络实现xor_在神经网络中实现逻辑门和XOR解决方案
  • sagan 自注意力_请使用英语:自我注意生成对抗网络(SAGAN)
  • pytorch 音频分类_Pytorch中音频的神经风格转换

pca 主成分分析_超越普通PCA:非线性主成分分析相关推荐

  1. python pca主成分_超越“经典” PCA:功能主成分分析(FPCA)应用于使用Python的时间序列...

    python pca主成分 FPCA is traditionally implemented with R but the "FDASRSF" package from J. D ...

  2. matlab pca降维_手撸PCA(Python七行代码实现)

    直接上代码: x = np.random.rand(10,5) #随机生成一组样本 x -= x.mean(axis=0) # 见详注1 C = x.T.dot(x) # 计算自协方差矩阵 lam,v ...

  3. 变压器耦合和电容耦合_超越变压器和抱抱面的分类

    变压器耦合和电容耦合 In this post, I plan to explore aspects of cutting edge architectures in NLP like BERT/Tr ...

  4. pca 主成分分析_六分钟的主成分分析(PCA)的直观说明。

    pca 主成分分析 Principle Component Analysis (PCA) is arguably a very difficult-to-understand topic for be ...

  5. JAVA实现PCA主成分分析_主成分分析PCA(principal component analysis)原理

    PCA在很多方面均有应用,但是之前没有仔细探究过,最近看了一些博客和论文,做一下总结. 主成分分析(Principal Component Analysis,PCA), 是一种统计方法.通过正交变换将 ...

  6. 三级指标 主成分分析_主成分分析法(PCA)

    主成分分析(Principal Component Analysis, PCA),将多个变量通过线性变换以选出较少个数重要变量的一种多元统计分析方法. 在实际生活中,为了全面的分析问题,往往提出很多相 ...

  7. pca降维python实例_主成分分析(Principal component analysis, PCA)例子–Python | 文艺数学君...

    摘要这一篇是关于PCA的实战, 我们会举一个例子, 看一下PCA具体在实战中是如何来进行的. 同时我们会比较同一个数据下, 使用PCA(主成分分析)和FA(因子分析)得到结果的不同. 简介 这一篇文章 ...

  8. pca各个向量之间的相关度_PCA主成分分析

    降维就是一种对高维度特征数据预处理方法.降维是将高维度的数据保留下最重要的一些特征,去除噪声和不重要的特征,从而实现提升数据处理速度的目的.降维的算法有很多,比如奇异值分解(SVD).主成分分析(PC ...

  9. OpenCV3.3中主成分分析(Principal Components Analysis, PCA)接口简介及使用

    OpenCV3.3中给出了主成分分析(Principal Components Analysis, PCA)的实现,即cv::PCA类,类的声明在include/opencv2/core.hpp文件中 ...

最新文章

  1. 一份完整的数据科学竞赛指南!
  2. 《系统集成项目管理》第十四章 项目采购管理
  3. 02.CSS基础笔记及导入
  4. 设计模式学习(五):行为型模式
  5. 在webpack和vue-cli上的rem适配终极方案
  6. 3005-基于二叉链表的二叉树最大宽度的计算(附思路,注释,可能错误分析)
  7. Kafka 分布式消息队列介绍
  8. Reflector 3在录制中如何添加自己的声音
  9. 从零基础入门Tensorflow2.0 ----八、39.2. gpu2
  10. 探讨VSTS联合MS PROJECT协同开发之三:比较篇
  11. atitit.thumb生成高质量缩略图 php .net c++ java
  12. Junit 4 的 @Before 和 @BeforeClass 对比 Junit 5 @BeforeEach 和 @BeforeAll
  13. 微信小程序商城后台服务器,首先【基础配置】:完成小程序关联商城后台及配置微信支付...
  14. 运用Doolitle分解法解线性方程组
  15. 魔兽各服务器位置,魔兽世界怀旧服矿点分布位置介绍 全地图采矿位置一览
  16. ANT 下载,ant的配法 整理
  17. 扭曲丛林服务器未响应,LOL等级最高玩家已246级 狂刷扭曲丛林攒经验
  18. ROS入门21讲笔记(一)基本概念
  19. 数据结构课设_网页形式的景区导游
  20. 【机器人学】机器人学领域的顶级期刊和会议

热门文章

  1. 杭州企业“被参与”互联网攻击致半个美国网络瘫痪
  2. 1451 - Average 高速求平均值
  3. javascript实现汉诺塔动画效果
  4. Silverlight 5 beta新特性探索系列:9.视频快进快退和TextSearch对象对文字项查询
  5. Linux内核态抢占机制分析
  6. centos 输入密码正确进不去系统
  7. 中关村-DIY高清之HDMI线导购
  8. http 使用curl发起https请求
  9. html中两个标签上对齐,css将两个元素水平对齐的方法(兼容IE8)
  10. centos 7.2 mysql 允许_CentOS 7.2 mysql-5.7.17 审计插件安装、开启与设定