diff --git a/DESCRIPTION b/DESCRIPTION index 89237b5..267c90c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -51,4 +51,4 @@ Suggests: Depends: R (>= 2.10) VignetteBuilder: knitr -RoxygenNote: 7.2.1 +RoxygenNote: 7.2.3 diff --git a/R/ggplots.R b/R/ggplots.R index 82619a7..8acbfca 100644 --- a/R/ggplots.R +++ b/R/ggplots.R @@ -80,9 +80,10 @@ ecdf_data <- function(actual, predicted){ #' #' 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) + @@ -550,6 +551,8 @@ gg_model_calibration <- function(model, newdata = NULL, #' #' data("woes") #' +#' woes <- head(woes) +#' #' pps <- gg_woes(woes) #' #' if(require(patchwork)){ @@ -563,8 +566,8 @@ gg_model_calibration <- function(model, newdata = NULL, #' } #' #' gg_woes(woes, variable = "woe") -#' gg_woes(woes, variable = "bin_iv") #' +#' gg_woes(woes, variable = "bin_iv") #' #' @export #' @importFrom patchwork get_dim @@ -633,6 +636,21 @@ gg_woes <- function(woes, } + +#' data("woes") +#' +# s <- scorecard::scorecard2( +# bins = woes, +# dt = credit, +# "bad", +# points0 = 500, +# odds0 = 1/20, +# pdo = 20 +# ) +# +# s + + # p1 <- gg_model_ks(m) + # ggplot2::labs(subtitle = "No facet") # p1 diff --git a/R/model-feature-selection.R b/R/model-feature-selection.R index fee2c63..9fc8392 100644 --- a/R/model-feature-selection.R +++ b/R/model-feature-selection.R @@ -235,7 +235,7 @@ featsel_brute_force <- function(model, level = 0.95, verbose = TRUE) { vars_conf_problems <- dplyr::filter(dconf, .data$lower < 0 & .data$upper > 0) vars_conf_problems <- dplyr::pull(vars_conf_problems, .data$term) - vars_with_problems <- unique(c(vars_sign_problems, vars_conf_problems)) + vars_with_problems <- unique(c(vars_conf_problems, vars_sign_problems)) if(length(vars_with_problems) == 0){ diff --git a/dev/risk3r.Rmd b/dev/risk3r.Rmd index b147bd9..8657157 100644 --- a/dev/risk3r.Rmd +++ b/dev/risk3r.Rmd @@ -34,6 +34,9 @@ library(randomForest) library(performance) library(parameters) library(broom) + +data("credit") + # if(require(kunstomverse)){ library(extrafont)