Creates 'auditor_model_residual' that contains sorted residuals. An object can be further used to generate plots. For the list of possible plots see see also section.

model_residual(object)

modelResiduals(object)

Arguments

object

An object of class 'explainer' created with function explain from the DALEX package.

See also

Examples

titanic <- na.omit(DALEX::titanic) titanic$survived <- titanic$survived == "yes" # fit a model model_glm <- glm(survived ~ ., family = binomial, data = titanic) # use DALEX package to wrap up a model into explainer exp_glm <- DALEX::explain(model_glm, data = titanic, y = titanic$survived)
#> Preparation of a new explainer is initiated #> -> model label : lm (default) #> -> data : 2099 rows 9 cols #> -> target variable : 2099 values #> -> predict function : yhat.glm will be used (default) #> -> predicted values : numerical, min = 9.814966e-09 , mean = 0.3244402 , max = 1 #> -> residual function : difference between y and yhat (default) #> -> residuals : numerical, min = -0.9614217 , mean = -1.68201e-09 , max = 0.9666502 #> A new explainer has been created!
# validate a model with auditor library(auditor) model_residual(exp_glm)
#> Model label: lm #> Quantiles of Residuals: #> 0% 10% 20% 30% 40% 50% #> -0.96142167 -0.31682530 -0.24470080 -0.19360742 -0.14683833 -0.10056616 #> 60% 70% 80% 90% 100% #> -0.04356944 0.05425887 0.28030987 0.70886448 0.96665021