필터 지우기
필터 지우기

How to apply pca() [Matlab] on high dimensional data

조회 수: 5 (최근 30일)
Atinesh Singh
Atinesh Singh 2016년 8월 14일
댓글: Akash Reddy 2020년 11월 10일
I want to apply `pca()` function in `matlab` on data with `500 dimensions`. But pca() has a limit of only 99 dimensions. Do I have to write code for pca.

채택된 답변

the cyclist
the cyclist 2016년 8월 14일
Why do you believe pca has such a limit?
p = pca(rand(1000,700));
runs just fine.
  댓글 수: 4
the cyclist
the cyclist 2016년 8월 17일
I think I finally appreciate what you are missing.
You have more dimensions (p=700) than you have observations (n=100). When p>n, you can fully explain all the variation in the observations with n-1 principal components, which in your case is 99.
Akash Reddy
Akash Reddy 2020년 11월 10일
Thanks sir.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

John D'Errico
John D'Errico 2016년 8월 14일
편집: John D'Errico 2016년 8월 14일
I think the problem is you don't understand the PCA code, at least how to use the tool as provided. READ THE HELP! A problem with size 100x700 for the PCA function is a problem with 700 dimensions, not 100. PCA treats each ROW of the array as one sample, one observation.
Your question (coupled with your later comment) strongly implies that your array is simply transposed from what you need to pass into the PCA tool. Read the help for PCA.
  댓글 수: 2
Atinesh Singh
Atinesh Singh 2016년 8월 16일
I've read the documentation. It's clearly mentioned that pca() takes input a matrix of dimension n-by-p where n = # observations and p = # variables and return a matrix with dimension p-by-p where each column is a principal component with decreasing variance. Hence when we pca() on matrix with dimension 100-by-700 it just return matrix with dimesnion 700-by-700.
Walter Roberson
Walter Roberson 2016년 8월 16일
It is not clear to me why you think that pca has a limit of 99 dimensions?
I had no problem at all a moment ago running pca on a 1000 x 1000 matrix.

댓글을 달려면 로그인하십시오.


Taimour Hamayoun
Taimour Hamayoun 2017년 10월 25일
hello! i am new in matlab and i am try to apply PCA on my dataset of 19 dimensions and try to reduce it in 4 dimension but i didnt find the proper way plz guide and provide me a proper source with explanation thanx
  댓글 수: 1
the cyclist
the cyclist 2017년 10월 27일
May I suggest that you carefully read the documentation and this answer of mine, to get a better understanding of the syntax and output of pca?
Also, you posted this as an answer to a question. It would have garnered more attention as a new question, but I happened to see it.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by