This function returns default options for modelStudio
.
It is possible to modify values of this list and pass it to the options
parameter in the main function. WARNING: Editing default options may cause
unintended behavior.
ms_options(...)
Options to change in the form option_name = value
.
list
of options for modelStudio
.
TRUE
Makes every plot the same height, ignores bar_width
.
TRUE
Display boxplots in Feature Importance and Shapley Values plots.
TRUE
Should the subtitle be displayed?
label
parameter from explainer
.
Title of the dashboard.
Subtitle of the dashboard (makes space between the title and line).
Dashboard margins. Change margin_top
for more ms_subtitle
space.
Plot margins. Change margin_left
for longer/shorter axis labels.
420
in px. Inner plot width.
280
in px. Inner plot height.
16
in px. Default width of bars for all plots,
ignored when scale_plot = TRUE
.
2
in px. Default width of lines for all plots.
3
in px. Default point radius for all plots.
[#46bac2,#46bac2,#371ea3]
#8bdcbe
for Break Down and Shapley Values bars.
#f05a71
for Break Down and Shapley Values bars.
#371ea3
for Break Down bar and highlighted line.
**
is a two letter code unique to each plot, might be
one of [bd,sv,cp,fi,pd,ad,rv,fd,tv,at]
.
Plot-specific title. Default varies.
Plot-specific subtitle. Default is subtitle
.
Plot-specific axis title. Default varies.
Plot-specific width of bars. Default is bar_width
,
ignored when scale_plot = TRUE
.
Plot-specific width of lines. Default is line_size
.
Plot-specific point radius. Default is point_size
.
Plot-specific [bar,line,point]
color. Default is [bar,line,point]_color
.
The input object is implemented in DALEX
Feature Importance, Ceteris Paribus, Partial Dependence and Accumulated Dependence explanations are implemented in ingredients
Break Down and Shapley Values explanations are implemented in iBreakDown
library("DALEX")
library("modelStudio")
# fit a model
model_apartments <- glm(m2.price ~. , data = apartments)
# create an explainer for the model
explainer_apartments <- explain(model_apartments,
data = apartments,
y = apartments$m2.price)
#> Preparation of a new explainer is initiated
#> -> model label : lm ( default )
#> -> data : 1000 rows 6 cols
#> -> target variable : 1000 values
#> -> predict function : yhat.glm will be used ( default )
#> -> predicted values : No value for predict function target column. ( default )
#> -> model_info : package stats , ver. 4.3.1 , task regression ( default )
#> -> predicted values : numerical, min = 1781.848 , mean = 3487.019 , max = 6176.032
#> -> residual function : difference between y and yhat ( default )
#> -> residuals : numerical, min = -247.4728 , mean = -2.992196e-13 , max = 469.0023
#> A new explainer has been created!
# pick observations
new_observation <- apartments[1:2,]
rownames(new_observation) <- c("ap1","ap2")
# modify default options
new_options <- ms_options(
show_subtitle = TRUE,
bd_subtitle = "Hello World",
line_size = 5,
point_size = 9,
line_color = "pink",
point_color = "purple",
bd_positive_color = "yellow",
bd_negative_color = "orange"
)
# make a studio for the model
modelStudio(explainer_apartments,
new_observation,
options = new_options,
N = 200, B = 5) # faster example