Is object of class "permshap"?

is.permshap(object)

Arguments

object

An R object.

Value

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

See also

Examples

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