library(cheem)
## Regression setup:
dat <- amesHousing2018_NorthAmes
X <- dat[, 1:9]
Y <- dat$SalePrice
clas <- dat$SubclassMS
## Cheem list
ames_rf_chm <- cheem_ls(X, Y, ames_rf_shap, ames_rf_pred, clas,
label = "North Ames, RF, SHAP")
## Cheem visuals
if(interactive()){
prim <- 1
comp <- 2
global_view(ames_rf_chm, primary_obs = prim, comparison_obs = comp)
bas <- sug_basis(ames_rf_chm, prim, comp)
mv <- sug_manip_var(ames_rf_chm, primary_obs = prim, comp)
ggt <- radial_cheem_tour(ames_rf_chm, basis = bas, manip_var = mv)
animate_plotly(ggt)
}
## Save for use with shiny app (expects an rds file)
if(FALSE){ ## Don't accidentally save.
saveRDS(ames_rf_chm, "./chm_NAmes_rf_tshap.rds")
run_app() ## Select the saved rds file from the data drop down.
}
Run the code above in your browser using DataLab