Reducing a dataset’s dimensions with PCA and projecting it onto a graph.
Hi all,
Like the title says, I’d like to take a large dataset X of m by n size and reduce it’s dimensions to m by 2 length, and from there project it onto a 2D plane where the axis are the two main principal components of X. Is the below code enough, or have I missed a step?
[a,b] = pca(X);
b = b’;
plot(b(1,:),b(2,:),’.’);
From what I understand, taking the two columns of b gives me the two principal components that tell us the most about X’s structure, whilst having reduced it’s dimensions down. I’m basing this on the <http://www.nlpca.org/pca-principal-component-analysis-matlab.html code I found here,> but I just wanted to check I had it correct.Hi all,
Like the title says, I’d like to take a large dataset X of m by n size and reduce it’s dimensions to m by 2 length, and from there project it onto a 2D plane where the axis are the two main principal components of X. Is the below code enough, or have I missed a step?
[a,b] = pca(X);
b = b’;
plot(b(1,:),b(2,:),’.’);
From what I understand, taking the two columns of b gives me the two principal components that tell us the most about X’s structure, whilst having reduced it’s dimensions down. I’m basing this on the <http://www.nlpca.org/pca-principal-component-analysis-matlab.html code I found here,> but I just wanted to check I had it correct. Hi all,
Like the title says, I’d like to take a large dataset X of m by n size and reduce it’s dimensions to m by 2 length, and from there project it onto a 2D plane where the axis are the two main principal components of X. Is the below code enough, or have I missed a step?
[a,b] = pca(X);
b = b’;
plot(b(1,:),b(2,:),’.’);
From what I understand, taking the two columns of b gives me the two principal components that tell us the most about X’s structure, whilst having reduced it’s dimensions down. I’m basing this on the <http://www.nlpca.org/pca-principal-component-analysis-matlab.html code I found here,> but I just wanted to check I had it correct. pca, matlab, dimension reduction, datasets, data handling MATLAB Answers — New Questions