View source: R/2_visualization.r
sug_basis | R Documentation |
Extract and formats the 1D attribution basis from the provided local explanation.
sug_basis(attr_df, rownum)
attr_df |
A data frame of local explanation attributions. |
rownum |
The rownumber of the observation. Typically primary or comparison observations. |
A matrix of the 1D basis.
radial_cheem_tour()
Other cheem utility:
as_logical_index()
,
color_scale_of()
,
contains_nonnumeric()
,
is_discrete()
,
is_diverging()
,
linear_tform()
,
logistic_tform()
,
problem_type()
,
rnorm_from()
,
sug_manip_var()
library(cheem)
## Attribution basis of the primary instance
sug_basis(ames_rf_shap, rownum = 1)
## This can be used to find a basis to start the radial tour.
# ?radial_cheem_tour
## Regression setup:
dat <- amesHousing2018_NorthAmes
X <- dat[, 1:9]
Y <- dat$SalePrice
clas <- dat$SubclassMS
## radial_cheem_tour()
ames_rf_chm <- cheem_ls(X, Y, ames_rf_shap, ames_rf_pred, clas,
label = "North Ames, RF, SHAP")
bas <- sug_basis(ames_rf_shap, 1)
mv <- sug_manip_var(ames_rf_shap, 1, 2)
ggt <- radial_cheem_tour(ames_rf_chm, basis = bas, manip_var = mv)
if(interactive()){
## As a plotly html widget
spinifex::animate_plotly(ggt)
## As a gganimation
spinifex::animate_gganimate(ggt, render = gganimate::av_renderer())
}
## radial_cheem_tour is also used in: ?run_app()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.