Variable importance for partykit conditional inference trees, using various performance measures.

EasyTreeVarImp(ct, nsim = 1)

Arguments

ct

A tree of class constparty (as returned by ctree from partykit package).

nsim

Integer specifying the number of Monte Carlo replications to perform. Default is 1. If nsim > 1, the results from each replication are simply averaged together.

Details

If the response variable is a factor, AUC (if response is binary), accuracy, balanced accuracy and true predictions by class are used. If the response is numeric, r-squared and Kendall's tau are used.

Value

A data frame of variable importances, with variables as rows and performance measures as columns.

References

Hothorn T, Hornik K, Van De Wiel MA, Zeileis A. "A lego system for conditional inference". The American Statistician. 60:257–263, 2006.

Hothorn T, Hornik K, Zeileis A. "Unbiased Recursive Partitioning: A Conditional Inference Framework". Journal of Computational and Graphical Statistics, 15(3):651-674, 2006.

Author

Nicolas Robette

See also

ctree

Examples

  data(iris)
  iris2 = iris
  iris2$Species = factor(iris$Species == "versicolor")
  iris.ct = partykit::ctree(Species ~ ., data = iris2)
  EasyTreeVarImp(iris.ct, nsim = 1)
#>       Variable   AUC accuracy balanced accuracy Species.FALSE Species.TRUE
#> 1 Sepal.Length 0.000     0.00             0.000          0.00         0.00
#> 2  Sepal.Width 0.249     0.22             0.235          0.11         0.26
#> 3 Petal.Length 0.000     0.00             0.000          0.00         0.00
#> 4  Petal.Width 0.205     0.12             0.155          0.14         0.24