how can I do PCA on a table ?

조회 수: 31 (최근 30일)
LO
LO 2019년 5월 30일
댓글: Star Strider 2019년 6월 7일
I have a 3000 x 18 table containing 18 variables (one per column) of both numerical and categorical type (6 categorical).
I would liket to do PCA on the whole dataset
but the command
[coeff,score]=pca(mytable) does not work.
any idea on how to proceed ?

채택된 답변

Star Strider
Star Strider 2019년 5월 30일
The pca function only accepts single-precision or double-precision numerical arrays. You most likely need to use the table2array (link) function first, to get the numeric data out of your table and into a form that pca can use.
  댓글 수: 4
LO
LO 2019년 6월 7일
Got it, thanks. I thought categorical PCA was also possible with MATLAB.
Perhaps the answer is no. I will try to then exclude the non numerical variables and see if it works !
Star Strider
Star Strider 2019년 6월 7일
It should work in that instance.

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

추가 답변 (0개)

카테고리

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