我怎样才能知道在构造树中实际使用了哪些变量?
model = tree(status~., set.train)
如果我写,我可以看到变量:
summary(model)
tree(formula = status ~ ., data = set.train)
Variables actually used in tree construction:
[1] "spread1" "MDVP.Fhi.Hz." "DFA" "D2" "RPDE" "MDVP.Shimmer" "Shimmer.APQ5"
Number of terminal nodes: 8
Residual mean deviance: 0.04225 = 5.831 / 138
Distribution of residuals:
Min. 1st Qu. Median Mean 3rd Qu. Max.
-0.9167 0.0000 0.0000 0.0000 0.0000 0.6667
但是我怎样才能得到一个向量,实际使用了哪些变量的索引?