|
DATA MINING
Desktop Survival Guide by Graham Williams |
|
|||
You can build a conditional tree using ctree from the party package:
library("party")
load("wine.Rdata")
wine.ctree <- ctree(Type ~ ., data=wine)
pdf("graphics/rplot-ctree.pdf")
plot(wine.ctree)
dev.off()
|
> wine.ctree
Conditional tree with 5 terminal nodes
Response: Type
Inputs: Alcohol, Malic, Ash, Alcalinity, Magnesium, Phenols,
Flavanoids, Nonflavanoids, Proanthocyanins, Color,
Hue, Dilution, Proline
Number of observations: 178
1) Flavanoids <= 1.57; criterion = 1, statistic = 127.131
2) Hue <= 0.89; criterion = 1, statistic = 36.136
3)* weights = 47
2) Hue > 0.89
4)* weights = 15
1) Flavanoids > 1.57
5) Proline <= 714; criterion = 1, statistic = 82.158
6)* weights = 54
5) Proline > 714
7) Alcohol <= 13.05; criterion = 1, statistic = 20.638
8)* weights = 10
7) Alcohol > 13.05
9)* weights = 52
|