Model Performance Plots

model_performance(explainer, ...)

Arguments

explainer

a model to be explained, preprocessed by the 'explain' function

...

other parameters

Value

An object of the class 'model_performance_explainer'.

References

Predictive Models: Visual Exploration, Explanation and Debugging https://pbiecek.github.io/PM_VEE/

Examples

library("randomForest") HR_rf_model <- randomForest(status == "fired"~., data = HR, ntree = 100)
#> Warning: The response has five or fewer unique values. Are you sure you want to do regression?
explainer_rf <- explain(HR_rf_model, data = HR, y = HR$status == "fired") model_performance(explainer_rf)
#> 0% 10% 20% 30% 40% 50% #> -0.85732596 -0.50098313 -0.37975468 -0.27447380 0.07962973 0.11369357 #> 60% 70% 80% 90% 100% #> 0.16333830 0.21392233 0.29230448 0.40730286 0.75516513
HR_glm_model <- glm(status == "fired"~., data = HR, family = "binomial") explainer_glm <- explain(HR_glm_model, data = HR, y = HR$status == "fired", predict_function = function(m,x) predict.glm(m,x,type = "response")) mp_ex_glm <- model_performance(explainer_glm) mp_ex_glm
#> 0% 10% 20% 30% 40% 50% #> -0.98205373 -0.55235667 -0.41461652 -0.30976313 0.02245228 0.06123718 #> 60% 70% 80% 90% 100% #> 0.12851638 0.22772548 0.37762011 0.54512663 0.77559013
plot(mp_ex_glm)
HR_lm_model <- lm(status == "fired"~., data = HR) explainer_lm <- explain(HR_lm_model, data = HR, y = HR$status == "fired") model_performance(explainer_lm)
#> 0% 10% 20% 30% 40% 50% #> -1.13838567 -0.53762473 -0.44185859 -0.36475626 -0.10022291 0.06849654 #> 60% 70% 80% 90% 100% #> 0.19721668 0.30740814 0.42304458 0.53120373 0.70835161