View source: R/ms_update_observations.R
ms_update_observations | R Documentation |
This function calculates local explanations on new observations and adds them
to the modelStudio
object.
ms_update_observations( object, explainer, new_observation = NULL, new_observation_y = NULL, max_features = 10, B = 10, show_info = TRUE, parallel = FALSE, widget_id = NULL, overwrite = FALSE, ... )
object |
A |
explainer |
An |
new_observation |
New observations with columns that correspond to variables used in the model. |
new_observation_y |
True label for |
max_features |
Maximum number of features to be included in BD and SV plots.
Default is |
B |
Number of permutation rounds used for calculation of SV and FI.
Default is |
show_info |
Verbose a progress on the console. Default is |
parallel |
Speed up the computation using |
widget_id |
Use an explicit element ID for the widget (rather than an automatically generated one).
Useful e.g. when using |
overwrite |
Overwrite existing observations and their explanations.
Default is |
... |
Other parameters. |
An object of the r2d3, htmlwidget, modelStudio
class.
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
Vignettes: modelStudio - R & Python examples and modelStudio - perks and features
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 # add new observations ms <- ms_update_observations(ms, explainer_titanic, new_observation = titanic_imputed[100:101,], new_observation_y = titanic_imputed$survived[100:101]) ms # overwrite the observations with new ones ms <- ms_update_observations(ms, explainer_titanic, new_observation = titanic_imputed[100:101,], overwrite = TRUE) ms
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.