C5imp | R Documentation |
This function calculates the variable importance (aka attribute usage) for C5.0 models.
C5imp(object, metric = "usage", pct = TRUE, ...)
object |
an object of class |
metric |
either 'usage' or 'splits' (see Details below) |
pct |
a logical: should the importance values be converted to be between 0 and 100? |
... |
other options (not currently used) |
By default, C5.0 measures predictor importance by determining the percentage
of training set samples that fall into all the terminal nodes after the
split (this is used when metric = "usage"
). For example, the
predictor in the first split automatically has an importance measurement of
100 percent. Other predictors may be used frequently in splits, but if the
terminal nodes cover only a handful of training set samples, the importance
scores may be close to zero. The same strategy is applied to rule-based
models as well as the corresponding boosted versions of the model.
There is a difference in the attribute usage numbers between this output and the nominal command line output. Although the calculations are almost exactly the same (we do not add 1/2 to everything), the C code does not display that an attribute was used if the percentage of training samples covered by the corresponding splits is very low. Here, the threshold was lowered and the fractional usage is shown.
When metric = "splits"
, the percentage of splits associated with each
predictor is calculated.
a data frame with a column Overall
with the predictor usage
values. The row names indicate the predictor.
Original GPL C code by Ross Quinlan, R code and modifications to C by Max Kuhn, Steve Weston and Nathan Coulter
Quinlan R (1993). C4.5: Programs for Machine Learning. Morgan Kaufmann Publishers, http://www.rulequest.com/see5-unix.html
C5.0()
, C5.0Control()
,
summary.C5.0()
,predict.C5.0()
library(modeldata) data(mlc_churn) treeModel <- C5.0(x = mlc_churn[1:3333, -20], y = mlc_churn$churn[1:3333]) C5imp(treeModel) C5imp(treeModel, metric = "splits")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.