本文介绍了如何设置截止,而在星火训练数据随机森林的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用星火MLIB训练数据,使用随机森林算法分类。该MLIB提供了随机森林类具有的 trainClassifier 的方法,它确实需要的。

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.

我可以设定一个阈值,而训练数据集,类似于 截止选项R中的的随机森林的封装。

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

我发现在随机森林 MLIB的类提供了一些选项只有通过树木,杂质,类等数数,但有没有像阈值切关闭选项可用。它可以用任何方式来完成。

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.

推荐答案

短的版本是否定的,如果我们看看 RandomForestClassifier.scala 你可以看到,它始终只是选择最大。你可以重写,如果predict功能,但它不是超级干净。我添加了一个JIRA跟踪添加此。

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.

这篇关于如何设置截止,而在星火训练数据随机森林的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 18:50