importance: Variable Importance Ranking

View source: R/importance.R

importanceR Documentation

Variable Importance Ranking

Description

Produces a variable importance ranking from a fitted dpart object.

Usage

## S3 method for class 'dpart'
importance(x)

## S3 method for class 'dpart'
importance(x)

Arguments

x

object of class dpart

Details

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.

References

Breiman, L., Friedman, J.H., Olshen, R.A. and Stone, C.J. (1984) Classification and Regression Trees. Wadsworth International.

See Also

dpart

Examples


# 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)

pkuhnert/diet documentation built on June 10, 2025, 2:59 a.m.