Learn R Programming

modelStudio (version 3.1.2)

ms_merge_observations: Merge the observations of modelStudio objects

Description

This function merges local explanations from multiple modelStudio objects into one.

Usage

ms_merge_observations(...)

Value

An object of the r2d3, htmlwidget, modelStudio class.

Arguments

...

modelStudio objects created with modelStudio().

References

  • 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

See Also

Examples

Run this code
# \donttest{
library("DALEX")
library("modelStudio")

# fit a model
model_happiness <- glm(score ~., data = happiness_train)

# create an explainer for the model
explainer_happiness <- explain(model_happiness,
                               data = happiness_test,
                               y = happiness_test$score)

# make studios for the model
ms1 <- modelStudio(explainer_happiness,
                   N = 200,  B = 5)

ms2 <- modelStudio(explainer_happiness,
                   new_observation = head(happiness_test, 3),
                   N = 200,  B = 5)

# merge 
ms <- ms_merge_observations(ms1, ms2)
ms
# }

Run the code above in your browser using DataLab