TreeStab.Rd
Assesses the stability of conditional inference trees through the partition of observations in the terminal nodes and the frequency of the variables used for splits.
TreeStab(ct, B = 20)
A tree of class constparty
(as returned by ctree
from partykit
package).
Numerical value. The number of bootstrap replications. Default is 20.
A list of two elements :
average Jaccard index of concordance between the partition (terminal nodes) of ct and the partitions of bootstrap trees
a data frame with splitting variables in rows and two statistics in columns : their frequency of use in the tree vs in the bootstrap trees, and
The study of splitting variables used in the original tree and in bootstrap trees in directly inspired from the approach implemented in stablelearner
package.
The other side of this functions also uses bootstrap trees, this time to compute the Jaccard index of concordance between partitions, to assess the stability of the partition of observations in the terminal nodes of the tree.
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.
Philipp M, Zeileis A, Strobl C (2016). "A Toolkit for Stability Assessment of Tree-Based Learners". In A. Colubi, A. Blanco, and C. Gatu (Eds.), Proceedings of COMPSTAT 2016 - 22nd International Conference on Computational Statistics (pp. 315-325). The International Statistical Institute/International Association for Statistical Computing. Preprint available at https://EconPapers.RePEc.org/RePEc:inn:wpaper:2016-11
ctree
data(iris)
iris2 = iris
iris2$Species = factor(iris$Species == "versicolor")
iris.ct = partykit::ctree(Species ~ ., data = iris2)
TreeStab(iris.ct, B = 10)
#> $partition
#> [1] 0.1777278
#>
#> $variables
#> vars Freq Freq_boot Prob Prob_boot
#> 1 Petal.Width 1 1.2 1 0.8
#> 2 Sepal.Width 2 1.3 1 1.0
#>