Username Remember Me?
Password   forgot password?
   
   
create dataset
Posted: 17 February 2009 03:57 PM   [ Ignore ]  
Newbie
Rank
Total Posts:  14
Joined  2009-02-17

Hi there

I am new with prtools. I am trying to create a dataset and train adaboost but i keep getting this error:
??? Error using ==> vertcat
CAT arguments dimensions are not consistent.

Error in ==> affine at 3
R = [cos(r) -sin(r) 0;

Error in ==> nmc at 52
W = affine([R -R],[offset -offset],a,getlablist(a));

Error in ==> map at 115
d = feval(mapp,a,pars{:});

Error in ==> E:\Tkaravides\prtools_ac\prtools\@mapping\mtimes.p>mtimes at 15

Error in ==> adaboostc at 84
w = b*clasf; % train weak classifier

It seems that I don’t give enough data. I used struct(A) to check my dataset settings and I found some strange results with ident and featdom but I can’t solve it with setident or something

Regards

Profile
 
 
Posted: 17 February 2009 04:14 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  240
Joined  2008-04-26

Dear Thomasson,

could you post the code that leads to your error?

Pavel

[ Edited: 17 February 2009 04:20 PM by pavel]
Profile
 
 
Posted: 17 February 2009 04:40 PM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  14
Joined  2009-02-17

Dear Pavel

my code is simple. I create a matrix Data <324x76500double> and a label column of <324x1double> then A=dataset(Data,labs);
and w=adaboostc(A)

with weakc it did not work but with treec it did. I think I have to see what treec does, and see if it suits me.

Thanks a lot

Thomasson

Profile
 
 
Posted: 17 February 2009 05:17 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  240
Joined  2008-04-26

Dear Thomasson,

what a feature size! :-) I can train the adaboost using weakc on data with the similar number of samples and features.
One thing I noticed in your error message above: Don’t you have your own affine function on the Matlab path? The PRTools affine does not have any [cos(r) -sin(r) code in it:

Error in ==> affine at 3 
[cos(r) -sin(r0;

Error in ==> nmc at 52 
affine([R -R],[offset -offset],a,getlablist(a));

Can you try ‘which affine’ to see what routine is actually called?

Pavel

Profile
 
 
Posted: 17 February 2009 05:19 PM   [ Ignore ]   [ # 4 ]  
Moderator
RankRankRankRank
Total Posts:  253
Joined  2008-11-08

Dear Thomasson,

Your dataset has a very high dimension (76500). Thereby linear classifiers generated by
weakc may have a problem. Treec makes a decision tree by thresholding the most informative
features recursively (and splitting the training set accordingly). This is still feasible
for high dimensions. You may also try stumpc, which is a weak version of treec.

Best regards,

Bob Duin

Profile
 
 
Posted: 17 February 2009 05:22 PM   [ Ignore ]   [ # 5 ]  
Newbie
Rank
Total Posts:  14
Joined  2009-02-17

Dear Pavel

well it seems that since I have specified many file paths in my directory it uses mfiles from other parts of my project. this one is one that i use to collect SIFT features. Do you think I will have a problem with that? Thanks for the information. I have so many features because I use pixel values that I get from Harr like feature filtering. I even need more…

Thomasson

Profile
 
 
Posted: 17 February 2009 05:26 PM   [ Ignore ]   [ # 6 ]  
Newbie
Rank
Total Posts:  14
Joined  2009-02-17

Dear Bob Duin

thanks for the reply. I am wondering if I can observe which these most informative features are, so I can use less features, because with that feature vector I have memory problems

regards
Thomasson

Profile
 
 
Posted: 17 February 2009 05:40 PM   [ Ignore ]   [ # 7 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  240
Joined  2008-04-26

Dear Thomasson,

regarding the path, I think you do get the error when training the PRTools adaboost with weak base classifier simply because it requires PRTools affine.m mapping and you already have other affine.m on your path. Either rename your affine function or separate the feature computation and training steps (and keep only PRTools on Matlab path when you’re training, not your other code).

If you want to use adaboost to select the Haar-like features similarly to the Viola & Jones face detection algorithm, maybe just use decision stump base classifier (stumpc) as Bob suggested. Stumpc selects the feature based on some criterion and trains a threshold for that feature:

>> w=adaboostc(a,stumpc([],'maxcrit',1), 100)
Weighted Voting2 to 2 trained  mapping   -->; wvotec

Hope it helps,

Pavel

Profile
 
 
   
 
 
‹‹ Run svmr on Linux      qld / qp error ››