ukoethe / vigra

a generic C++ library for image analysis
http://ukoethe.github.io/vigra/
Other
411 stars 192 forks source link

Sampling bug in RFs #98

Open cbecker opened 12 years ago

cbecker commented 12 years ago

If stratification is set to RF_EQUAL and sampling is done without replacement when training a Random Forest then vigra crashes. I found this out by chance when playing around with 'wrong' flags with the matlab interface. I understand that setting these two flags to the given state for training does not make sense if the training set is not exactly balanced.

I suppose that this condition can be avoided by modifying RandomForestOptions<>.

cbecker commented 12 years ago

On second thoughts, maybe the solution would be to limit the amount of samples per tree according to the class that has the least amount of samples, so that the two conditions mentioned above can be met.