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.

...

other parameters

Value

An object of the class auditor_model_residual.

See also

Examples

library(DALEX) # fit a model model_glm <- glm(m2.price ~ ., data = apartments) glm_audit <- explain(model_glm, data = apartments, y = apartments$m2.price)
#> Preparation of a new explainer is initiated #> -> model label : lm ( default ) #> -> data : 1000 rows 6 cols #> -> target variable : 1000 values #> -> predict function : yhat.glm will be used ( default ) #> -> predicted values : No value for predict function target column. ( default ) #> -> model_info : package stats , ver. 4.1.1 , 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!
# validate a model with auditor mr <- model_residual(glm_audit) mr
#> Model label: lm #> Quantiles of Residuals: #> 0% 10% 20% 30% 40% 50% 60% 70% #> -247.4728 -219.5419 -209.7820 -196.5370 -183.8511 -172.7964 -162.0042 368.5918 #> 80% 90% 100% #> 391.1693 420.3496 469.0023
plot(mr)