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