Summarizes "kernelshap" Object
# S3 method for class 'kernelshap'
summary(object, compact = FALSE, n = 2L, ...)
Invisibly, the input is returned.
fit <- lm(Sepal.Length ~ ., data = iris)
s <- kernelshap(fit, iris[1:3, -1], bg_X = iris[, -1])
#> Exact Kernel SHAP values
#>
|
| | 0%
|
|======================= | 33%
|
|=============================================== | 67%
|
|======================================================================| 100%
summary(s)
#> Exact Kernel SHAP values
#> - SHAP matrix of dim 3 x 4
#> - baseline: 5.843333
#> - m_exact: 14
#>
#> SHAP values of first observations:
#> Sepal.Width Petal.Length Petal.Width Species
#> [1,] 0.21951350 -1.955357 0.3149451 0.5823533
#> [2,] -0.02843097 -1.955357 0.3149451 0.5823533