One weight per channel, for the area of applicability, from an importance.
Source:R/importance.R
importance_weights.RdThe dissimilarity index measures how far a pixel is from the training data, one axis per channel. Unweighted, a channel the model ignores counts as much as the one it leans on, and a pixel unlike the training data in an ignored channel falls outside the area of applicability for nothing. Meyer & Pebesma (2021) weight each axis by the predictor's importance; this gives each channel its variable's importance – every channel of a one-hot set, or of a group of yours, its variable's – and a negative importance, noise around zero, weight zero.
Arguments
- x
A
dsm_importancewith one value per variable: bypermutation_importance(),shap_importance(),sage_importance(),refit_importance()orale_effect().
Value
A named numeric vector, one weight per channel in the store's order,
for dsm_predict(aoa_weights = ) or aoa_reference(weights = ).
Examples
if (FALSE) { # torch::torch_is_installed()
# \donttest{
run <- example_run() # a small fitted run, made once a session
imp <- dsm_importance(run$final, run$data, shap_importance(samples = 20, background = 20),
verbose = FALSE)
importance_weights(imp) # for dsm_predict(aoa_weights = ) or aoa_reference(weights = )
# }
}