View source: R/model_cooksdistance.R
model_cooksdistance | R Documentation |
Calculates Cook's distances for each observation.
Please, note that it will work only for functions with specified update
method.
model_cooksdistance(object)
observationInfluence(object)
object |
An object of class |
An object of the class auditor_model_cooksdistance
.
Cook, R. Dennis (1977). "Detection of Influential Observations in Linear Regression". doi:10.2307/1268249.
data(titanic_imputed, package = "DALEX")
# fit a model
model_glm <- glm(survived ~ ., family = binomial, data = titanic_imputed)
# use DALEX package to wrap up a model into explainer
glm_audit <- audit(model_glm,
data = titanic_imputed,
y = titanic_imputed$survived)
# validate a model with auditor
mc <- model_cooksdistance(glm_audit)
mc
plot(mc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.