library(cheem)
## Classification setup
X <- chocolates[, 5:14]
Y <- chocolates$Type
clas <- chocolates$Type
## Cheem
choc_chm <- cheem_ls(X, Y, chocolates_svm_shap, chocolates_svm_pred, clas,
label = "Chocolates, LM, shap")
## Save for use with shiny app (expects an rds file)
if(FALSE){ ## Don't accidentally save.
saveRDS(choc_chm, "./chm_chocolates_svm_shap.rds")
run_app() ## Select the saved rds file from the data dropdown.
}
## Cheem visuals
if(interactive()){
prim <- 1
comp <- 2
global_view(peng_chm, primary_obs = prim, comparison_obs = comp)
bas <- sug_basis(penguin_xgb_shap, prim, comp)
mv <- sug_manip_var(penguin_xgb_shap, primary_obs = prim, comp)
ggt <- radial_cheem_tour(peng_chm, basis = bas, manip_var = mv)
animate_plotly(ggt)
}
Run the code above in your browser using DataLab