potential_interactions: Interaction Strength

View source: R/sv_dependence.R

potential_interactionsR Documentation

Interaction Strength

Description

Returns vector of interaction strengths between variable v and all other variables.

Usage

potential_interactions(obj, v)

Arguments

obj

An object of class "shapviz".

v

Variable name.

Details

If SHAP interaction values are available, interaction strength between feature v and another feature ⁠v'⁠ is measured by twice their mean absolute SHAP interaction values. Otherwise, we use as heuristic the squared correlation between feature values of ⁠v'⁠ and SHAP values of v, averaged over (binned) values of v. A numeric v with more than n_bins unique values is binned into quantile bins. Currently n_bins equals the smaller of n/20 and \sqrt n, where n is the sample size. The average squared correlation is weighted by the number of non-missing feature values in the bin. Note that non-numeric color features are turned to numeric by calling data.matrix(), which does not necessarily make sense.

Value

A named vector of decreasing interaction strengths.

See Also

sv_dependence()


shapviz documentation built on Oct. 14, 2023, 5:07 p.m.