The breakDown package explains predictions from black-box models, such as random forest, xgboost, svm or neural networks (it works for lm and glm as well). As a result you gets decomposition of prediction that can be attributed to particular variables.

The version 0.3 has a new function _down. It identifies pairwise of variables. So if the model is not additive, then instead of seeing effects of single variables you will see effects for .
It’s easy to use this function. See an example below.
HR is an artificial dataset. The break_down function correctly identifies interaction between gender and age. Find more examples in the documentation.

#
# Create a model for classification
library("")
library("randomForest")
model                         contribution
#> (Intercept)                   0.386
#> * hours = 42                  0.231
#> * salary = 2                 -0.216
#> * age:gender = 58:male        0.397
#> * evaluation = 2             -0.019
#> final_prognosis               0.778
#> baseline:  0 

plot(bd_rf)

Figure below shows that a single prediction was decomposed into 4 parts. One of them is related to the interaction between age and gender.

BreakDown is a part of DALEXverse – collection of tools for visualisation, exploration and explanation of complex machine learning models.

Till the end of September I am visiting UC Davis and UC Berkeley. Happy to talk about DALEX explainers, XAI and related stuff.
So, if you want to talk about interpretability of complex ML models, just let me know.

Yes, it’s part of the DALEX invasion 😉


Thanks to the H2020 project RENOIR.


R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more…


If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook





Source link https://www.r-bloggers.com/break-down-model--with-interactions-and-dalex-in-the-/

LEAVE A REPLY

Please enter your comment!
Please enter your name here