gg_model_roc: Plot models

View source: R/ggplots.R

gg_model_rocR Documentation

Plot models

Description

Plot models

Usage

gg_model_roc(model, newdata = NULL, ...)

gg_model_ecdf(model, newdata = NULL, ...)

gg_model_dist(model, newdata = NULL, alpha = 0.5, ...)

gg_model_coef(model, level = 0.95, show_intercept = FALSE, ...)

gg_model_corr(model, upper = FALSE, ...)

gg_model_vif(model, colors = c("#3aaf85", "#1b6ca8", "#cd201f"), ...)

gg_model_importance(model, ...)

gg_model_importance2(model, bins, ...)

gg_model_partials(model, newdata = NULL, verbose = TRUE, ...)

gg_model_calibration(
  model,
  newdata = NULL,
  alpha = 0.01,
  color = "black",
  size = 1,
  alpha_smooth = 0.5,
  color_smooth = "#3366FF",
  size_smooth = 1,
  ...
)

Arguments

model

model

newdata

newdata

...

Additional arguments for celavi::variable_importance.

alpha

alpha

level

= 0.95

show_intercept

show_intercept

upper

upper

colors

colors

bins

bins

verbose

verbose

color

color

size

size

alpha_smooth

alpha_smooth

color_smooth

color_smooth

size_smooth

size_smooth

Examples


data("credit_woe")

m <- glm(bad ~ ., family = binomial, data = head(credit_woe, 10000))
m <- featsel_stepforward(m, scale = 5, trace = 0)

dnew <- tail(credit_woe, 10000)

gg_model_roc(m)
gg_model_roc(m, newdata = dnew, size = 2)

gg_model_ecdf(m)
gg_model_ecdf(m, newdata = dnew, size = 2)

gg_model_dist(m)
gg_model_dist(m, newdata = dnew, alpha = 0.4, color = "transparent")

gg_model_calibration(m)
gg_model_calibration(m, newdata = dnew, alpha = 0.05, size = 2)

gg_model_coef(m)

gg_model_corr(m)

gg_model_vif(m)

gg_model_importance(m)

gg_model_partials(m)

gg_model_coef(m) + ggplot2::coord_flip() + ggplot2::scale_y_discrete(limits = rev)
gg_model_vif(m)  + ggplot2::coord_flip() + ggplot2::scale_x_discrete(limits = rev)
gg_model_corr(m, upper = TRUE)
gg_model_corr(m, upper = TRUE) +
 ggplot2::coord_flip() +
 ggplot2::scale_y_discrete(limits = rev) +
 ggplot2::scale_x_discrete(limits = rev)


data("credit_woe")

m <- glm(bad ~ ., family = binomial, data = head(credit_woe, 10000))
m <- featsel_stepforward(m, scale = 5, trace = 0)

bins <- scorecard::woebin(credit, "bad", no_cores = 1)

gg_model_importance2(m, bins)
gg_model_importance2(m, bins, fill = "gray60", width = 0.5)


jbkunst/risk3r documentation built on March 19, 2024, 10:49 p.m.