data(titanic_imputed, package = "DALEX")
model_glm <- glm(survived ~ ., family = binomial, data = titanic_imputed)
audit_glm <- audit(model_glm,
data = titanic_imputed,
y = titanic_imputed$survived)
p_fun <- function(model, data) { predict(model, data, response = "link") }
audit_glm_newpred <- audit(model_glm,
data = titanic_imputed,
y = titanic_imputed$survived,
predict.function = p_fun)
library(randomForest)
model_rf <- randomForest(Species ~ ., data=iris)
audit_rf <- audit(model_rf)
Run the code above in your browser using DataLab