0
votes

I am using Spark Mlib to train the data for classification using Random Forest Algorithm. The MLib provides a RandomForest Class which has trainClassifier Method which does the required.

Can I set a threshold value while training the data set, similar to the cutoff option provided in R's randomForest Package.

http://cran.r-project.org/web/packages/randomForest/randomForest.pdf

I found the RandomForest Class of MLib provides options only to pass number of trees, impurity, number of classes etc but there is nothing like threshold or cut off option available. Can it be done by any way.

1

1 Answers

0
votes

The short version is no, if we look at RandomForestClassifier.scala you can see that it always simply selects the max. You could override the predict function if, but its not super clean. I've added a jira to track adding this.