Skip to contents

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.

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)
#> [1] 4
## This can be used to find a basis to start the radial tour.
# ?radial_cheem_tour