importance | R Documentation |
Produces a variable importance ranking from a fitted dpart
object.
## S3 method for class 'dpart'
importance(x)
## S3 method for class 'dpart'
importance(x)
x |
object of class |
A barplot of the variable importance ranking sorted from highest to lowest is produced in addition to the printed output.
Variable importance ranking for the variables used in the classification tree.
Breiman, L., Friedman, J.H., Olshen, R.A. and Stone, C.J. (1984) Classification and Regression Trees. Wadsworth International.
dpart
# Assigning prey colours for default palette
val <- apc(x = yftdiet, preyfile = PreyTaxonSort, check = TRUE)
node.colsY <- val$cols
dietPP <- val$x # updated diet matrix with Group assigned prey taxa codes
# Fitting the classification tree
yft.dp <- dpart(Group ~ Lat + Lon + Year + Quarter + SST + Length,
data = dietPP, weights = W, minsplit = 10,
cp = 0.001)
yft.pr <- prune(yft.dp, se = 1)
vi <- importance(yft.pr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.