shap.importance: Variable importance as measured by mean absolute SHAP value.

View source: R/SHAP_funcs.R

shap.importanceR Documentation

Variable importance as measured by mean absolute SHAP value.

Description

Variable importance as measured by mean absolute SHAP value.

Usage

shap.importance(data_long, names_only = FALSE, top_n = Inf)

Arguments

data_long

a long format data of SHAP values from shap.prep

names_only

If TRUE, returns variable names only.

top_n

How many variables to be returned?

Value

returns data.table with average absolute SHAP values per variable, sorted in decreasing order of importance.

Examples


shap.importance(shap_long_iris)

shap.importance(shap_long_iris, names_only = 1)


SHAPforxgboost documentation built on May 31, 2023, 8:20 p.m.