jiandanjinxin / randomforest-matlab

Automatically exported from code.google.com/p/randomforest-matlab
0 stars 0 forks source link

segmentation violation on high-dim dataset #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. attempt to train a RF with a high-dimensional dataset (34
1300-dimensional vectors), using 101 trees and mtry=200 features:

myRF = classRF_train(foo_vecs(2:35,1:1300),foo_classLabels(2:35,:),101,200);

foo_vecs is a 36 x 4005 matrix of doubles
foo_classLabels is a 36 x 1 vector of doubles (-1,+1)
(see attached file)

What is the expected output? What do you see instead?
Expected: a trained RF.
Instead: a segmentation violation, with stack trace:

  [0] mexClassRF_train.mexmaci64:makeA(double*, int, int, int*, int*,
int*)~ + 151 bytes
  [1] mexClassRF_train.mexmaci64:classRF(double*, int*, int*, int*, int*,
int*, int*, int*, int*, int*, int*, int*, double*, double*, int*, int*,
int*, double*, double*, double*, double*, int*, int*, int*, int*, int*,
int*, double*, double*, int*, double*, int*, int*, double*, int*, int,
double*, double*, int*)~ + 2673 bytes
  [2] mexClassRF_train.mexmaci64:mexFunction~ + 3192 bytes
 ... more stuff

What version of the product are you using? On what operating system?
Version svn-v8? (0.02), MacOSX 10.6.2, Matlab 7.9.0.529 (R2009b) 64 bits, 
Intel Core 2 Duo (x86 Family 6 Model 7 Stepping 10). Mex file compiled from
source.

Note: the mex file works fine until the training set reaches about 34 x
1200, thereafter crashes. Could it be a memory allocation issue?

Original issue reported on code.google.com by Jonas.Richiardi@gmail.com on 26 Feb 2010 at 4:22

Attachments:

GoogleCodeExporter commented 8 years ago
this is peculiar as i can see it happening when matlab is run in GUI mode

but not when matlab is running as console only via matlab -nojvm

i'll sit and look through the code (gdb dont work at all with matlab gui), but 
till 
then you can always run the code in console mode 

thanks jonas

Original comment by abhirana on 26 Feb 2010 at 9:27

GoogleCodeExporter commented 8 years ago
This is due to the package expecting X_trn to be in doubles.

double(foo_vecs) will solve this

I'll put the datatype check in the next release.

Original comment by abhirana on 2 Mar 2010 at 4:07

GoogleCodeExporter commented 8 years ago

Original comment by abhirana on 2 Mar 2010 at 4:44