This is an DALEX. Unverified black box model is the path to the failure. Opaqueness leads to distrust. Distrust leads to ignoration. Ignoration leads to rejection.
The DALEX package xrays any model and helps to explore and explain its behaviour, helps to understand how complex models are working. The main function explain() creates a wrapper around a predictive model. Wrapped models may then be explored and compared with a collection of local and global explainers. Recent developments from the area of Interpretable Machine Learning/explainable Artificial Intelligence.
The philosophy behind DALEX explanations is described in the Explanatory Model Analysis e-book. The DALEX package is a part of DrWhy.AI universe.
options(warn = -1)
library(modelStudio)
library(DALEX)
## Welcome to DALEX (version: 2.2.0).
## Find examples and detailed introduction at: http://ema.drwhy.ai/
## Additional features will be available after installation of: ggpubr.
## Use 'install_dependencies()' to get all suggested dependencies
library(DALEXtra)
library(ranger)
# fit a model
model <- ranger(survived ~., data = titanic_imputed)
# create an explainer for the model
explainer <- explain(model, data = titanic_imputed, y=titanic_imputed$survived,
label = 'Random Forest')
## Preparation of a new explainer is initiated
## -> model label : Random Forest
## -> data : 2207 rows 8 cols
## -> target variable : 2207 values
## -> predict function : yhat.ranger will be used ( [33m default [39m )
## -> predicted values : No value for predict function target column. ( [33m default [39m )
## -> model_info : package ranger , ver. 0.12.1 , task regression ( [33m default [39m )
## -> predicted values : numerical, min = 0.008995892 , mean = 0.3226641 , max = 0.9919562
## -> residual function : difference between y and yhat ( [33m default [39m )
## -> residuals : numerical, min = -0.7712412 , mean = -0.0005072972 , max = 0.8740659
## [32m A new explainer has been created! [39m
# make a studio for the model
modelStudio(explainer)
## `new_observation` argument is NULL. `new_observation_n` observations needed to calculate local explanations are taken from the data.