Skip to content
Branch: master
Find file Copy path
Find file Copy path
2 contributors

Users who have contributed to this file

@hbaniecki @pbiecek
103 lines (67 sloc) 3.14 KB

dime: Deep Interactive Model Explanations

Automate Explaining Machine Learning Predictive Models

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Build Status Coverage Status

This package generates advanced interactive and animated model explanations in the form of serverless HTML site.

It combines R with D3.js to produce plots and descriptions for local and global explanations. The whole is greater than the sum of its parts, so it also supports EDA on top of that. ModelStudio is a fast and condensed way to get all the answers without much effort. Break down your model and look into its ingredients with only a few lines of code.

See an examplemodelStudio - perks and features

The package dime is a part of the DrWhy.AI universe.

Find more about model explanations in Predictive Models: Visual Exploration, Explanation and Debugging e-book.


Install from GitHub:

# dependencies

# dime

Make sure that all dependencies are up-to-date with GitHub.


This package bases on DALEX::explain().


Create a model:

 titanic <- na.omit(titanic)
 titanic_small <- titanic[, c(1,2,3,6,7,9)]

 model_titanic_glm <- glm(survived == "yes" ~ gender + age + fare + class + sibsp,
                          data = titanic_small, family = "binomial")

Wrap it into an explainer:

 explain_titanic_glm <- explain(model_titanic_glm,
                                data = titanic_small[, -6],
                                y = titanic_small$survived == "yes",
                                label = "glm")

Pick some data points:

 new_observations <- titanic_small[1:4, -6]
 rownames(new_observations) <- c("Lucas", "James", "Thomas", "Nancy")

Make a studio for the model:

 modelStudio(explain_titanic_glm, new_observations, N = 100, B = 10)

More examples here.


You can save modelStudio using controls on the top of the RStudio Viewer or with r2d3::save_d3_html() and r2d3::save_d3_png().


Cheat Sheet


You can’t perform that action at this time.