1
学习mllib DecisionTree模型后(http://spark.apache.org/docs/latest/mllib-decision-tree.html)如何计算节点的统计数据,如支持(有多少样本此子匹配),而多少样本每个标签的匹配子树?统计星火mllib DecisionTree
如果它更容易,我也乐于接受任何其他工具比星火采取调试字符串,并计算这些统计数据。调试字符串的例子:
DecisionTreeModel classifier of depth 20 with 20031 nodes
If (feature 0 <= -35.0)
If (feature 24 <= 176.0)
If (feature 0 <= -200.0)
If (feature 29 <= 109.0)
If (feature 6 <= -156.0)
If (feature 9 <= 0.0)
If (feature 20 <= -116.0)
If (feature 16 <= 203.0)
If (feature 11 <= 163.0)
If (feature 5 <= 384.0)
If (feature 15 <= 325.0)
If (feature 13 <= -248.0)
If (feature 20 <= -146.0)
Predict: 0.0
Else (feature 20 > -146.0)
If (feature 19 <= -58.0)
Predict: 6.0
Else (feature 19 > -58.0)
Predict: 0.0
Else (feature 13 > -248.0)
If (feature 9 <= -26.0)
Predict: 0.0
Else (feature 9 > -26.0)
If (feature 10 <= 218.0)
...
我使用的,因为外的核心学习的mllib,这是我需要的,因为数据不适合到内存中。如果你有比mllib更好的选择,我很乐意给他们一个尝试。
,因为他们不支持在线/出核心培训的我不能使用sklearn决策树。但是,你得到看起来可能是我想要的输出(你有两个标签,点击和转化是这样吗?)。你能提供一些代码来获得这个输出吗?我是否也可以从spark mllib模型中获取它? – DreamFlasher
我已经更新了我的答案。 – RoyaumeIX