Prints "kernelshap" Object

# S3 method for kernelshap
print(x, n = 2L, ...)

Arguments

x

An object of class "kernelshap".

n

Maximum number of rows of SHAP values to print.

...

Further arguments passed from other methods.

Value

Invisibly, the input is returned.

See also

Examples

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%
s
#> 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