ms_update_options: Update the options of a modelStudio object

Description Usage Arguments Value Options References See Also Examples

View source: R/ms_update_options.R

Description

This function updates the options of a modelStudio object. WARNING: Editing default options may cause unintended behavior.

Usage

1

Arguments

object

A modelStudio created with modelStudio().

...

Options to change in the form option_name = value, e.g. time = 0, facet_dim = c(1,2).

Value

An object of the r2d3, htmlwidget, modelStudio class.

Options

Main options:

scale_plot

TRUE Makes every plot the same height, ignores bar_width.

show_boxplot

TRUE Display boxplots in Feature Importance and Shapley Values plots.

show_subtitle

TRUE Should the subtitle be displayed?

subtitle

label parameter from explainer.

ms_title

Title of the dashboard.

ms_subtitle

Subtitle of the dashboard (makes space between the title and line).

ms_margin_*

Dashboard margins. Change margin_top for more ms_subtitle space.

margin_*

Plot margins. Change margin_left for longer/shorter axis labels.

w

420 in px. Inner plot width.

h

280 in px. Inner plot height.

bar_width

16 in px. Default width of bars for all plots, ignored when scale_plot = TRUE.

line_size

2 in px. Default width of lines for all plots.

point_size

3 in px. Default point radius for all plots.

[bar,line,point]_color

[#46bac2,#46bac2,#371ea3]

positive_color

#8bdcbe for Break Down and Shapley Values bars.

negative_color

#f05a71 for Break Down and Shapley Values bars.

default_color

#371ea3 for Break Down bar and highlighted line.

Plot specific options:

** is a two letter code unique to each plot, might be one of [bd,sv,cp,fi,pd,ad,rv,fd,tv,at].

**_title

Plot specific title. Default varies.

**_subtitle

Plot specific subtitle. Default is subtitle.

**_bar_width

Plot specific width of bars. Default is bar_width, ignored when scale_plot = TRUE.

**_line_size

line_size Plot specific width of lines. Default is line_size.

**_point_size

Plot specific point radius. Default is point_size.

**_*_color

Plot specific [bar,line,point] color. Default is [bar,line,point]_color.

References

See Also

Vignettes: modelStudio - R & Python examples and modelStudio - perks and features

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library("DALEX")
library("modelStudio")

# fit a model
model_titanic <- glm(survived ~., data = titanic_imputed, family = "binomial")

# create an explainer for the model
explainer_titanic <- explain(model_titanic,
                             data = titanic_imputed,
                             y = titanic_imputed$survived)

# make a studio for the model
ms <- modelStudio(explainer_titanic,
                  N = 200,  B = 5) # faster example

# update the options
new_ms <- ms_update_options(ms,
                            time = 0,
                            facet_dim = c(1,2),
                            margin_left = 150)
new_ms

modelStudio documentation built on Jan. 13, 2021, 8:12 p.m.