|
31 | 31 | #' See \href{https://modelstudio.drwhy.ai/articles/ms-perks-features.html#instance-explanations}{\bold{vignette}}
|
32 | 32 | #' @param facet_dim Dimensions of the grid. Default is \code{c(2,2)}.
|
33 | 33 | #' @param time Time in ms. Set the animation length. Default is \code{500}.
|
34 |
| -#' @param max_features Maximum number of features to be included in BD and SV plots. |
| 34 | +#' @param max_features Maximum number of features to be included in BD, SV, and FI plots. |
35 | 35 | #' Default is \code{10}.
|
| 36 | +#' @param max_features_fi Maximum number of features to be included in FI plot. Default is \code{max_features}. |
36 | 37 | #' @param max_vars An alias for \code{max_features}. If provided, it will override the value.
|
37 | 38 | #' @param N Number of observations used for the calculation of PD and AD. Default is \code{300}.
|
38 | 39 | #' See \href{https://modelstudio.drwhy.ai/articles/ms-perks-features.html#more-calculations-means-more-time}{\bold{vignette}}
|
@@ -178,6 +179,7 @@ modelStudio.explainer <- function(explainer,
|
178 | 179 | facet_dim = c(2,2),
|
179 | 180 | time = 500,
|
180 | 181 | max_features = 10,
|
| 182 | + max_features_fi = NULL, |
181 | 183 | N = 300,
|
182 | 184 | N_fi = N*10,
|
183 | 185 | N_sv = N*3,
|
@@ -208,6 +210,7 @@ modelStudio.explainer <- function(explainer,
|
208 | 210 | model_type <- explainer$model_info$type
|
209 | 211 |
|
210 | 212 | if (!is.null(max_vars)) max_features <- max_vars
|
| 213 | + if (is.null(max_features_fi)) max_features_fi <- max_features |
211 | 214 | if (!is.null(verbose)) show_info <- verbose
|
212 | 215 | if (is.null(N)) stop("`N` argument must be an integer")
|
213 | 216 | #if (identical(N_fi, numeric(0))) N_fi <- NULL
|
@@ -348,7 +351,7 @@ modelStudio.explainer <- function(explainer,
|
348 | 351 | "ingredients::accumulated_dependence (categorical)", show_info, pb, N/30)
|
349 | 352 | }
|
350 | 353 |
|
351 |
| - fi_data <- prepare_feature_importance(fi, max_features, options$show_boxplot, |
| 354 | + fi_data <- prepare_feature_importance(fi, max_features_fi, options$show_boxplot, |
352 | 355 | attr(loss_function, "loss_name"), ...)
|
353 | 356 | pd_data <- prepare_partial_dependence(pd_n, pd_c, variables = variable_names)
|
354 | 357 | ad_data <- prepare_accumulated_dependence(ad_n, ad_c, variables = variable_names)
|
|
0 commit comments