playerkk / drfi_matlab

MATLAB implementation of the paper Salient Object Detection: A Discriminative Regional Feature Integration Approach
50 stars 26 forks source link

How can I Train my own Random Forest regressor #1

Closed yanxurui closed 5 years ago

yanxurui commented 8 years ago

How can I Train my own regressor If I have a dataset of 20 images.

In train/trainSameLabelClassifier.m

same_label_classifier = train_boosted_dt_2c(trn_edata, [], trn_elab, 200, 20);
...
regressor = regRF_train( feat, lab, 200, 12, opt );

what shoud the 200,20,12 be?

and also in train/my_trainSegmentSaliencyRegressor.m

num_tree = 200;
mtry = 15;

looking forward your reply.

playerkk commented 8 years ago
  1. For boosted decision trees, 200 is the number of decision trees and 20 is the maximum number of nodes in each tree.
  2. For random forest regressor, 200 is also the number of trees. 12 is the number of features randomly sampled to train each node in the tree.

These parameters might be data dependent. A good way is to set them according to the validation error.