Username Remember Me?
Password   forgot password?
   
   
Problem when seting featdom
Posted: 08 January 2010 11:49 AM   [ Ignore ]  
Jr. Member
RankRank
Total Posts:  41
Joined  2008-07-11

Happy new year for all the PRtools team.

I am having a little problem with the setfeatdom function, I think that could be a bug. The problem arrises with the following code:

dsTarget_dataset = dataset( featureMatrix, labels)

100695 by 40 dataset with 14 classes: [74435 8066 7248 2542 150 83 2 6869 802 16 229 106 15 132]

dsTarget_dataset = setfeatdom(dsTarget_dataset, cFeaturesDomain, feature_properties.DirectionalFeatures );

Where featureMatrix is a [100695 x 40] matrix. Then for the features indexed by the feature_properties.DirectionalFeatures array I set the domains cFeaturesDomain. After this two instructions, when a try to sample the dataset with:

dsTarget_dataset(1:10,:)

the error arrises

??? Index exceeds matrix dimensions.

Error in ==> D:\Mariano\papers\ECG Classification\scripts\common\prtools\@dataset\subsref.p>subsref
at 78

I think that the problem is in the position of the features to set a new domain. For example, if I put the two features with new domain (indexes [38 39]) in the extreme right of the matrix, the problem is solved:

dsTarget_dataset = dataset( [featureMatrix(:,[1:37 40]) featureMatrix(:,[38 39])], labels);
dsTarget_dataset = setfeatdom(dsTarget_dataset, cFeaturesDomain, [39 40] );

dsTarget_dataset(1:10,:)
10 by 40 dataset with 14 classes: [9 0 0 0 0 0 0 0 0 0 0 0 0 1]

Hope to be clear enough, any comments or error I would be doing please tell me.

Best regards,
Mariano.

Profile
 
 
Posted: 09 January 2010 12:59 AM   [ Ignore ]   [ # 1 ]  
Moderator
RankRankRankRank
Total Posts:  250
Joined  2008-11-08

Yes, there is a bug. We will correct it in the next version of PRTools.
A workaround is that you first initialise the feature domains by

dsTarget_dataset = setfeatdom(dsTarget_dataset,cell(1,40));

and then perform your own setting.

Hope this helps,

Bob Duin

Profile
 
 
Posted: 09 January 2010 09:25 AM   [ Ignore ]   [ # 2 ]  
Jr. Member
RankRank
Total Posts:  41
Joined  2008-07-11

Yes thank you !

Profile
 
 
   
 
 
‹‹ question about bpxnc      adaboost sample ››