feyn.insights
class KernelShap
def __init__(
model,
bg_data,
max_samples=10000
) -> KernelShap
Calculates the SHAP values for a given feyn.Graph with your provided instances
method KernelShap.SHAP
def SHAP(
self,
instances
)
Calculates the SHAP values for the provided instances
Arguments:
instances {dict(str, np.array) or pd.DataFrame} -- One or more instances to get SHAP values for.
Returns:
[np.array] -- A numpy array (matrix) containing feature importances for your instances