Is object of class "kernelshap"?

is.kernelshap(object)

Arguments

object

An R object.

Value

TRUE if object is of class "kernelshap", and FALSE otherwise.

See also

Examples

fit <- lm(Sepal.Length ~ ., data = iris)
s <- kernelshap(fit, iris[1:2, -1], bg_X = iris[, -1])
#> Exact Kernel SHAP values
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |======================================================================| 100%
is.kernelshap(s)
#> [1] TRUE
is.kernelshap("a")
#> [1] FALSE