Username Remember Me?
Password   forgot password?
   
   
PCA problem
Posted: 01 August 2010 07:40 PM   [ Ignore ]  
Newbie
Rank
Total Posts:  26
Joined  2009-07-14

Hi,
I have two matrices:  samplesTR, size of <160x1458 double> and labelsTR, size of <1x1458 double>. I send you both.
I want to reduce dimension of matrix by PCA in PRTools.
Code: 
samplesTR = dataset(samplesTR’,labelsTR’);
samplesPCA = PCA(samplesTR,0.98);

Now, samplesPCA is reduced to <160x131 mapping>.
I want to use samplesPCA with labelsTR for SVM. But number of training samples and its labels are different from each other. (i.e. samplesPCA has size of <160x131 mapping> and labelsTR has <1x1458 double>.)
How can I obtain samplesPCA’s labels values? or how can I match these two matrices?
Regards..

File Attachments
SampLab.zip  (File Size: 14KB - Downloads: 85)
Profile
 
 
Posted: 01 August 2010 11:04 PM   [ Ignore ]   [ # 1 ]  
Moderator
RankRankRankRank
Total Posts:  250
Joined  2008-11-08

It should be realized that

samplesPCA

is a mapping computed from

samplesTR

.
It may be applied to any dataset, e.g. training sets as well as test sets in the original space.
After

SamplesTR_PCA samplesTR*samplesPCA

you have your data mapped into the PCA space.

Bob Duin

[ Edited: 05 August 2010 09:25 AM by BobDuin]
Profile
 
 
Posted: 02 August 2010 11:29 AM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  26
Joined  2009-07-14

Thanks Mr. Duin! Your reply is what I want.

Profile