crossval problem
Posted: 27 August 2009 09:48 AM   [ Ignore ]  
Newbie
Rank
Total Posts:  14
Joined  2009-07-02

Hi I’m trying to use crossval in the following demo code, and it keeps failng.
It there any known incompatibility with Matalb 2009a?

>> A1=gendatd(30);
A2=gendatd(20);
Aall={A1 A2};

W1=svc([],proxm[],'r',));
W2=svc([],proxm[],'p',));
Wall={W1 W2};

[ERR,CERR,NLAB_OUT] crossval(Aall,Wall,[]); 
??? 
Error using ==> mtimes
Inner matrix dimensions must agree
.

Error in ==> crossval at 225
                e 
f*getprior(data,0)';

Error in ==> crossval at 101
                [ee,cc,nn] = feval(mfilename,data{jd},classf{jc},n,nrep,testf);

Profile
 
 
Posted: 27 August 2009 09:50 AM   [ Ignore ]   [ # 1 ]  
Newbie
Rank
Total Posts:  14
Joined  2009-07-02

It also fails with the simpler scenario of 1 dataset and 1 classifier:

[ERR,CERR,NLAB_OUT] crossval(A1,W1,[]);
??? 
Error using ==> mtimes
Inner matrix dimensions must agree
.

Error in ==> crossval at 225
                e 
f*getprior(data,0)';

Profile
 
 
Posted: 27 August 2009 12:20 PM   [ Ignore ]   [ # 2 ]  
Moderator
RankRankRankRank
Total Posts:  108
Joined  2008-11-08

We didn’t test PRTools on Matlab2009 yet. Apparantly there is a problem.

Bob Duin

Profile
 
 
Posted: 27 August 2009 01:24 PM   [ Ignore ]   [ # 3 ]  
Newbie
Rank
Total Posts:  12
Joined  2009-07-15

I had the same problem on MATLAB 2008b with PRTools 4.1.5, so I have reverted to 4.1.4.

Profile
 
 
Posted: 27 August 2009 02:00 PM   [ Ignore ]   [ # 4 ]  
Newbie
Rank
Total Posts:  14
Joined  2009-07-02
MarcinBu - 27 August 2009 01:24 PM

I had the same problem on MATLAB 2008b with PRTools 4.1.5, so I have reverted to 4.1.4.

How do I get it? The downloads page only has 4.1.5.
Can you send it to me?

Profile
 
 
Posted: 27 August 2009 02:48 PM   [ Ignore ]   [ # 5 ]  
Moderator
RankRankRankRank
Total Posts:  108
Joined  2008-11-08

I cannot reproduce the problem with the most recent version of prtools 4.1.5 (19 Aug 2009).
The last version of 4.1.4 can be downloaded by http://prtools.org/files/prtools4.1.4.11Oct08.zip

Bob Duin

Profile
 
 
Posted: 27 August 2009 02:53 PM   [ Ignore ]   [ # 6 ]  
Newbie
Rank
Total Posts:  12
Joined  2009-07-15

Bob, you are right - I had this error in 4.1.5 of 15th August, now it works fine.

Profile
 
 
Posted: 31 August 2009 04:55 PM   [ Ignore ]   [ # 7 ]  
Newbie
Rank
Total Posts:  14
Joined  2009-07-02

4.1.4 worked (thanks for the link).
I also tried it with the latest 4.1.5 (19 Aug 2009) after MarcinBu’s comment and seems it has been fixed for that too. (I originaly had an earlier date version of 4.1.5)
everything ok.

Profile
 
 
Posted: 05 January 2010 06:49 PM   [ Ignore ]   [ # 8 ]  
Newbie
Rank
Total Posts:  2
Joined  2009-12-29

Hi,
I’m trying to use C4.5 algorithm from PRTools on pima-indians-diabetes database
( http://archive.ics.uci.edu/ml/machine-learning-databases/pima-indians-diabetes/ )
I’m not very advanced with machine learning so I’ve met some problems.
I tried to use cross validation function, but matlab crashes when I run it with all data (768 Instances). I tried this on matlab R2009b, and matlab 7.01. On matlab 7.01
a following error came out:

??? Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',Nto change the limitBe aware that exceeding your available stack space can crash MATLAB and/or your computer.


And it pointed at prtrace function.

Increasing recursion limit didn’t help.
PRTRACE OFF; command didn’t make any difference.
I also tried to comment out calls to prtrace in used functions (this is an empty function), but it didn’t help either. PRtrace was also called from binary files from PRtools subfolders, which cannot be read.
I put my code below:

dlmread('pima-indians-diabetes.data');
A=dataset(D(:,1:8),cast(D(:,9),'uint32'));
[Train,Test]=gendat(A,.5);% it sometimes work with 0.1
[WeightedAverageTestError
,TestErrorsPerClass,AssignedNumericLabels,CROSSVAL(Train,treec([],'infcrit',-1))% it always crashes when I use whole A as a first argument

Profile
 
 
Posted: 05 January 2010 10:18 PM   [ Ignore ]   [ # 9 ]  
Moderator
RankRankRankRank
Total Posts:  108
Joined  2008-11-08

The diabetes dataset contains some objects of different classes with equal feature values in subspaces in which the treec command tries to find a separation between these objects. This is a design error.
It can be circumvented by adding some noise: A = A+randn(768,8)*1e-6.

Bob Duin

Profile
 
 
Posted: 05 January 2010 11:38 PM   [ Ignore ]   [ # 10 ]  
Newbie
Rank
Total Posts:  2
Joined  2009-12-29

Thank you very much for your fast response. It works!

Profile