我使用party
包中的ctree()
構建了迴歸樹。 我的模型的結果有許多節點包含相等的因變量的概率(例如:A類= 0.33,B類= 0.33,C類= 0.33)。我想從模型中取出這些節點。包tree
有snip.tree()
命令,我們可以指定要從模型中刪除的節點號。此命令不能識別使用ctree()
構建的迴歸樹。請讓我知道,如果有一種方法可以刪除迴歸樹中的某些節點使用ctree()
如何從`party`包中的`ctree()`構建的迴歸樹中刪除某些節點
建我已經使用的模型:
rv.mod1 <- ctree(ldclas ~ L2 + L3 + L4 + L5 + L6 + ele + ndvi + nd_var + nd_ps, data = rv, controls = ctree_control(minsplit = 0, minbucket = 0))
pr.rv.mod1 <- snip.tree(rv.mod1, nodes = nn2.rv.mod1$nodes)
nn2.rv.mod1 $節點與節點向量從rv.mod1刪除model.But我得到一個錯誤:
Error in snip.tree(rv.mod1, nodes = nn2.rv.mod1$nodes) :
not legitimate tree
你能告訴我們你已經嘗試了嗎?另外:請閱讀[如何問一個好問題]的幫助頁面(http://stackoverflow.com/help/how-to-ask) – Jaap