sug_manip_var {cheem}R Documentation

Suggest a manipulation variable

Description

Suggest the number of the variable with the largest difference in attribution between the primary and comparison observations.

Usage

sug_manip_var(attr_df, primary_obs, comparison_obs)

Arguments

attr_df

A data frame of local explanation attributions.

primary_obs

The rownumber of the primary observation. Its local attribution becomes the 1d projection basis, and the point it highlighted as a dashed line.

comparison_obs

The rownumber of the comparison observation. Point is highlighted as a dotted line.

Value

A single number of the variable with the largest difference of attribution (basis) variables.

See Also

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_basis()

Examples

library(cheem)

## Regression setup
dat  <- amesHousing2018_NorthAmes
X    <- dat[, 1:9]
Y    <- dat$SalePrice
clas <- dat$SubclassMS

## Suggest the number of a variable to manipulate
sug_manip_var(ames_rf_shap, primary_obs = 1, comparison_obs = 2)
## This can be used to find a basis to start the radial tour.
# ?radial_cheem_tour

[Package cheem version 0.4.0.0 Index]