Print Explainer Summary

# S3 method for explainer
print(x, ...)

Arguments

x

a model explainer created with the `explain` function

...

other parameters

Examples


aps_lm_model4 <- lm(m2.price~., data = apartments)
aps_lm_explainer4 <- explain(aps_lm_model4, data = apartments, y = apartments$m2.price,
                             label = "model_4v")
#> Preparation of a new explainer is initiated
#>   -> model label       :  model_4v 
#>   -> data              :  1000  rows  6  cols 
#>   -> target variable   :  1000  values 
#>   -> predict function  :  yhat.lm  will be used (  default  )
#>   -> predicted values  :  No value for predict function target column. (  default  )
#>   -> model_info        :  package stats , ver. 4.2.3 , task regression (  default  ) 
#>   -> predicted values  :  numerical, min =  1781.848 , mean =  3487.019 , max =  6176.032  
#>   -> residual function :  difference between y and yhat (  default  )
#>   -> residuals         :  numerical, min =  -247.4728 , mean =  2.093656e-14 , max =  469.0023  
#>   A new explainer has been created!  
aps_lm_explainer4
#> Model label:  model_4v 
#> Model class:  lm 
#> Data head  :
#>   m2.price construction.year surface floor no.rooms    district
#> 1     5897              1953      25     3        1 Srodmiescie
#> 2     1818              1992     143     9        5     Bielany

 # \donttest{
library("ranger")
titanic_ranger_model <- ranger(survived~., data = titanic_imputed, num.trees = 50,
                               probability = TRUE)
explainer_ranger  <- explain(titanic_ranger_model, data = titanic_imputed[,-8],
                             y = titanic_imputed$survived,
                             label = "model_ranger")
#> Preparation of a new explainer is initiated
#>   -> model label       :  model_ranger 
#>   -> data              :  2207  rows  7  cols 
#>   -> target variable   :  2207  values 
#>   -> predict function  :  yhat.ranger  will be used (  default  )
#>   -> predicted values  :  No value for predict function target column. (  default  )
#>   -> model_info        :  package ranger , ver. 0.14.1 , task classification (  default  ) 
#>   -> predicted values  :  numerical, min =  0.007549603 , mean =  0.3235824 , max =  0.9959444  
#>   -> residual function :  difference between y and yhat (  default  )
#>   -> residuals         :  numerical, min =  -0.7983078 , mean =  -0.001425674 , max =  0.8726193  
#>   A new explainer has been created!  
explainer_ranger
#> Model label:  model_ranger 
#> Model class:  ranger 
#> Data head  :
#>   gender age class    embarked  fare sibsp parch
#> 1   male  42   3rd Southampton  7.11     0     0
#> 2   male  13   3rd Southampton 20.05     0     2
 # }