This report aims to present the capabilities of the package party in the field of decision tree based galss-box models.

The document is a part of the paper “Landscape of R packages for eXplainable Machine Learning”, S. Maksymiuk, A. Gosiewska, and P. Biecek. (https://arxiv.org/abs/2009.13248). It contains a real life use-case with a hand of titanic_imputed data set described in Section Example gallery for XAI packages of the article.

We did our best to show the entire range of the implemented explanations. Please note that the examples may be incomplete. If you think something is missing, feel free to make a pull request at the GitHub repository MI2DataLab/XAI-tools.

The list of use-cases for all packages included in the article is here.

Load titanic_imputed data set.

data(titanic_imputed, package = "DALEX")
titanic_imputed$survived <- as.factor(titanic_imputed$survived)

head(titanic_imputed)
##   gender age class    embarked  fare sibsp parch survived
## 1   male  42   3rd Southampton  7.11     0     0        0
## 2   male  13   3rd Southampton 20.05     0     2        0
## 3   male  16   3rd Southampton 20.05     1     1        0
## 4 female  39   3rd Southampton 20.05     1     1        1
## 5 female  16   3rd Southampton  7.13     0     0        1
## 6   male  25   3rd Southampton  7.13     0     0        1
library("party")

Fit a rules type model to the titanic imputed data.

model <- ctree(survived~., titanic_imputed)

Tree visualization

plot(model)

# Session info

sessionInfo()
## R version 4.0.2 (2020-06-22)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 17763)
## 
## Matrix products: default
## 
## locale:
## [1] LC_COLLATE=Polish_Poland.1250  LC_CTYPE=Polish_Poland.1250   
## [3] LC_MONETARY=Polish_Poland.1250 LC_NUMERIC=C                  
## [5] LC_TIME=Polish_Poland.1250    
## 
## attached base packages:
## [1] stats4    grid      stats     graphics  grDevices utils     datasets 
## [8] methods   base     
## 
## other attached packages:
## [1] party_1.3-5       strucchange_1.5-2 sandwich_2.5-1    zoo_1.8-8        
## [5] modeltools_0.2-23 mvtnorm_1.1-1    
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_1.0.4.6       knitr_1.28         magrittr_1.5       MASS_7.3-51.6     
##  [5] splines_4.0.2      lattice_0.20-40    rlang_0.4.7        multcomp_1.4-13   
##  [9] stringr_1.4.0      tools_4.0.2        parallel_4.0.2     xfun_0.12         
## [13] TH.data_1.0-10     htmltools_0.4.0    matrixStats_0.56.0 yaml_2.2.1        
## [17] survival_3.1-11    digest_0.6.25      libcoin_1.0-5      Matrix_1.2-18     
## [21] codetools_0.2-16   evaluate_0.14      rmarkdown_2.1      coin_1.3-1        
## [25] stringi_1.4.6      compiler_4.0.2