View source: R/plot_predict_diagnostics.R
plot.predict_diagnostics | R Documentation |
Plot Instance Level Residual Diagnostics
## S3 method for class 'predict_diagnostics' plot(x, ...)
x |
an object with instance level residual diagnostics created with |
... |
other parameters that will be passed to |
an ggplot2
object of the class gg
.
library("ranger") titanic_glm_model <- ranger(survived ~ gender + age + class + fare + sibsp + parch, data = titanic_imputed) explainer_glm <- explain(titanic_glm_model, data = titanic_imputed, y = titanic_imputed$survived) johny_d <- titanic_imputed[24, c("gender", "age", "class", "fare", "sibsp", "parch")] pl <- predict_diagnostics(explainer_glm, johny_d, variables = NULL) plot(pl) pl <- predict_diagnostics(explainer_glm, johny_d, neighbors = 10, variables = c("age", "fare")) plot(pl) pl <- predict_diagnostics(explainer_glm, johny_d, neighbors = 10, variables = c("class", "gender")) plot(pl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.