Data Science Desktop Survival Guide
by Graham Williams
Enhanced Plot: With Colour
col <- c("#FD8D3C", "#FD8D3C", "#FD8D3C", "#BCBDDC",
"#FDD0A2", "#FD8D3C", "#BCBDDC")
prp(model, type=2, extra=104, nn=TRUE, fallen.leaves=TRUE,
faclen=0, varlen=0, shadow.col="grey", branch.lty=3, box.col=col)
The fancyRpartPlot() function from rattle generates scaled colour for colouring the boxes depending on the decision and the strength. The hard work is in generating the scaled colours for the nodes. Here we use other palettes for the colours rather than those used by fancyRpartPlot().