pca

Matlab - PCA analysis and reconstruction of multi dimensional data

最后都变了- 提交于 2019-11-26 07:24:40
问题 I have a large dataset of multidimensional data(132 dimensions). I am a beginner at performing data mining and I want to apply Principal Components Analysis by using Matlab. However, I have seen that there are a lot of functions explained on the web but I do not understand how should they be applied. Basically, I want to apply PCA and to obtain the eigenvectors and their corresponding eigenvalues out of my data. After this step I want to be able to do a reconstruction for my data based on a

PCA

北慕城南 提交于 2019-11-26 06:07:05
对影像进行主成分分析,只有第一主成分被分离出来了,后面的主成分好像都相同 均值: 标准差: 方差: 描述数据之间关系的统计量 标准差和方差一般是用来描述一维数据的,但现实生活我们常常遇到含有多维数据的数据集。 面对这样的数据集,我们当然可以按照每一维独立的计算其方差,但是通常我们还想了解这几科成绩之间的关系,这时,我们就要用协方差,协方差就是一种用来度量两个随机变量关系的统计量 1.正向主成分(PC)旋转 正向PC旋转用一个线性变换使数据方差达到最大。当使用正向PC旋转时,ENVI允许计算新的统计值,或根据已经存在的统计值进行旋转。输出值可以存为字节型、浮点型、整型、长整型或双精度型。也可以基于特征值来提取PC旋转的输出内容,生成只包含所需的PC波段的输出。 计算新的统计值和旋转 使用Compute New Statistics and Rotate选项可以计算数据特征值、协方差或相关系数矩阵以及PC正向旋转。 选择Transforms > Principal Components > Forward PC Rotation > Compute New Statistics and Rotate。 当出现Principal Components Input File对话框时,选择输入文件或用标准ENVI选择程序选取子集。将会出现Forward PC Rotation

Add legend to scatter plot (PCA)

依然范特西╮ 提交于 2019-11-26 04:01:36
问题 I am a newbie with python and found this excellent PCA biplot suggestion (Plot PCA loadings and loading in biplot in sklearn (like R's autoplot)). Now I tried to add a legend to the plot for the different targets. But the command plt.legend() doesn\'t work. Is there an easy way to do it? As an example, the iris data with the biplot code from the link above. import numpy as np import matplotlib.pyplot as plt from sklearn import datasets from sklearn.decomposition import PCA import pandas as pd

Selecting multiple odd or even columns/rows for dataframe

不羁岁月 提交于 2019-11-26 03:57:19
问题 Is there a way in R to select many non-consecutive i.e. odd or even rows/columns? I\'m plotting the loadings for my Principal Components Analysis. I have 84 rows of data ordered like this: x_1 y_1 x_2 ..... x_42 y_42 And at the moment I am creating the dataframes for the x and y loadings figures like this: data.pc = princomp(as.matrix(data)) x.loadings <- data.frame(x=data.pc$loadings[c(1, 3, 5, 7, 9, 11, 13 ,15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41), 1]) yloadings <- data.frame

降维算法中的PCA方法

那年仲夏 提交于 2019-11-26 00:45:58
1 主成分分析 (Principal Component Analysis,PCA) 2 线性判别分析 (Linear Discriminant Analysis, LDA) 研究背景 基本知识介绍 经典方法介绍 总结讨论 问题的提出 地理系统是多要素的复杂系统。在地理学研究中,多变量问题是经常会遇到的。变量太多,无疑会增加分析问题的难度与复杂性,而且在许多实际问题中,多个变量之间是具有一定的相关关系的。 因此,人们会很自然地想到,能否在相关分析的基础上,用较少的新变量代替原来较多的旧变量,而且使这些较少的新变量尽可能多地保留原来变量所反映的信息? 降维的动机 原始观察空间中的样本具有极大的信息冗余 样本的高维数引发分类器设计的“维数灾难” 数据可视化、特征提取、分类与聚类等任务需求 在进行祝成分分析后后,竟然以97.4%的精度,用三个变量取代了原来的17个变量。 线性降维 通过特征的线性组合来降维 本质上是把数据投影到低维线性子空间 线性方法相对比较简单且容易计算 代表方法 主成分分析(PCA) 线性判别分析(LDA) 多维尺度变换(MDS) 主成分分析(PCA) [Jolliffe, 1986] 降维目的:寻找能够保持采样数据方差的最佳投影子空间 求解方法:对样本的散度矩阵进行特征值分解, 所求子空间为经过样本均值, 以最大特征值所对应的特征向量为方向的子空间 主成分分析