knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.align = "center" ) pkgload::load_all(helpers = FALSE, quiet = TRUE)
utils::data('titanic_imputed', package = "DALEX") titanic <- titanic_imputed titanic$survived <- factor(titanic$survived, levels = 1:0, c("Survived", "Perished")) titanic %>% dplyr::glimpse()
caret
modelcaret_model <- caret::train( survived ~ ., data = titanic, method = "glm", trControl = caret::trainControl(method = "none", classProbs = TRUE) )
caret
modelexplanations <- caret.explainer::instantiate_explainer(caret_model)
set.seed(1540) new_observation <- titanic %>% dplyr::sample_n(1) explanations$plot_break_down(new_observation = new_observation)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.