阅读背景:

如何在R中得到rpart (CART)决策树的属性?

来源:互联网 

I have the following rpart:

我有以下的部分:

library("partykit")
library("rpart")
res = rpart(Species ~., data = iris)
pres <- as.party(res)

> pres

Model formula:
Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width

Fitted party:
[1] root
|   [2] Petal.Length < 2.45: setosa (n = 50, err = 0.0%)
|   [3] Petal.Length >= 2.45
|   |   [4] Petal.Width < 1.75: versicolor (n = 54, err = 9.3%)
|   |   [5] Petal.Width >= 1.75: virginica (n = 46, err = 2.2%)

Number of inner nodes:    2
Number of terminal nodes: 3
librar



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: