解释 R 中的决策树回归输出
Interpreting decision tree regression output in R
我使用“树”包在 R 中创建了一个决策树,但是,当我查看模型的细节时,我很难解释结果。
模型的输出如下所示:
> model
node), split, n, deviance, yval
* denotes terminal node
1) root 23 16270.0 32.350
2) Y1 < 31 8 4345.0 59.880 *
3) Y1 > 31 15 2625.0 17.670
6) Y2 < 11.5 8 1310.0 26.000 *
7) Y2 > 11.5 7 124.9 8.143 *
我不明白功能后每行中显示的数字。什么是 16270.0 和 32.350?或者什么是 2625.0 和 17.670?为什么有些数字有星号?
感谢任何帮助。
谢谢
你得到的规则相当于下面的树
输出中的每一行都有五列。让我们看看你问的一个问题:
Y1 > 31 15 2625.0 17.670
Y1 > 31 is the splitting rule being applied to the parent node
15 is the number of points that would be at this node of the tree
2625.0 is the deviance at this node (used to decide how the split was made)
17.670 is what you would predict for points at this node
if you split no further.
星号表示叶节点 - 没有进一步分裂的节点。
所以在上面描述的节点中,Y1 > 31
,你可以停在那个节点并且
预测所有 15 个点为 17.670,但整棵树会将其拆分为
两个节点:一个 Y2 < 11.5 得 8 分,另一个得 7 分
Y2 > 11.5。如果进一步拆分,您将预测 26.0 为 8 分
Y2 < 11.5(且 Y1 > 31)并预测 Y2 > 11.5 的 7 个点为 8.143
(并且 Y1 > 31)。
我使用“树”包在 R 中创建了一个决策树,但是,当我查看模型的细节时,我很难解释结果。 模型的输出如下所示:
> model
node), split, n, deviance, yval
* denotes terminal node
1) root 23 16270.0 32.350
2) Y1 < 31 8 4345.0 59.880 *
3) Y1 > 31 15 2625.0 17.670
6) Y2 < 11.5 8 1310.0 26.000 *
7) Y2 > 11.5 7 124.9 8.143 *
我不明白功能后每行中显示的数字。什么是 16270.0 和 32.350?或者什么是 2625.0 和 17.670?为什么有些数字有星号? 感谢任何帮助。
谢谢
你得到的规则相当于下面的树
输出中的每一行都有五列。让我们看看你问的一个问题:
Y1 > 31 15 2625.0 17.670
Y1 > 31 is the splitting rule being applied to the parent node
15 is the number of points that would be at this node of the tree
2625.0 is the deviance at this node (used to decide how the split was made)
17.670 is what you would predict for points at this node
if you split no further.
星号表示叶节点 - 没有进一步分裂的节点。
所以在上面描述的节点中,Y1 > 31
,你可以停在那个节点并且
预测所有 15 个点为 17.670,但整棵树会将其拆分为
两个节点:一个 Y2 < 11.5 得 8 分,另一个得 7 分
Y2 > 11.5。如果进一步拆分,您将预测 26.0 为 8 分
Y2 < 11.5(且 Y1 > 31)并预测 Y2 > 11.5 的 7 个点为 8.143
(并且 Y1 > 31)。