From d112f69409d6bd13f8777c42df42e7760bc53d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Biecek?= Date: Tue, 10 Dec 2019 01:51:18 +0100 Subject: [PATCH] candidate fix for #79 --- NAMESPACE | 1 + NEWS.md | 3 +- R/accumulated_dependency.R | 2 +- R/aggregate_profiles.R | 40 +++++++++++++++-------- R/conditional_dependency.R | 2 +- man/accumulated_dependency.Rd | 35 +++++++------------- man/aggregate_profiles.Rd | 12 +++---- man/calculate_variable_profile.Rd | 18 +++------- man/calculate_variable_split.Rd | 6 ++-- man/ceteris_paribus.Rd | 29 ++++------------ man/ceteris_paribus_2d.Rd | 3 +- man/cluster_profiles.Rd | 12 ++----- man/conditional_dependency.Rd | 35 +++++++------------- man/describe.Rd | 29 +++++----------- man/feature_importance.Rd | 39 +++++++--------------- man/partial_dependency.Rd | 34 ++++++------------- man/plot.aggregated_profiles_explainer.Rd | 12 ++----- man/plot.ceteris_paribus_2d_explainer.Rd | 14 ++------ man/plot.ceteris_paribus_explainer.Rd | 13 ++------ man/plot.feature_importance_explainer.Rd | 3 +- man/plotD3_aggregated_profiles.Rd | 16 +++------ man/plotD3_ceteris_paribus.Rd | 20 +++--------- man/plotD3_feature_importance.Rd | 13 ++------ man/select_neighbours.Rd | 10 ++---- man/show_aggregated_profiles.Rd | 10 ++---- man/show_observations.Rd | 11 ++----- man/show_profiles.Rd | 10 ++---- man/show_residuals.Rd | 10 ++---- man/show_rugs.Rd | 12 ++----- 29 files changed, 142 insertions(+), 312 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index a58df4cd..ef1c92ec 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -57,6 +57,7 @@ importFrom(scales,trans_new) importFrom(stats,aggregate) importFrom(stats,as.dist) importFrom(stats,cutree) +importFrom(stats,dnorm) importFrom(stats,hclust) importFrom(stats,lm) importFrom(stats,model.frame) diff --git a/NEWS.md b/NEWS.md index e2053e44..baeed1d2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,11 @@ ingredients 0.4.2 --------------------------------------------------------------- +* `aggregate_profiles` use now gaussian kernel smoothing. Use the `span` argument for fine control over this parameter ([#79](https://github.com/ModelOriented/ingredients/issues/79)) * change `variable_type` and `variables` arguments usage in the `aggregate_profiles`, `plot.ceteris_paribus` and `plotD3.ceteris_paribus` * remove `variable_type` argument from `plotD3.aggregated_profiles` (now the same as in `plot.aggregated_profiles`) -* Kasia Pekala is removed from the contributors as `aspect_importance` is moved to `DALEXtra` +* Kasia Pekala is moved as contributor to the `DALEXtra` as `aspect_importance` is moved to `DALEXtra` as well ([See v0.3.12 changelog](https://modeloriented.github.io/ingredients/news/index.html#ingredients-0-3-12)) * added Travis-CI for OSX diff --git a/R/accumulated_dependency.R b/R/accumulated_dependency.R index ed98cea6..50ae593d 100644 --- a/R/accumulated_dependency.R +++ b/R/accumulated_dependency.R @@ -121,7 +121,7 @@ accumulated_dependency.default <- function(x, variable_splits = variable_splits, label = label, ...) - aggregate_profiles(cp, variables = variables, type = "accumulated", variable_type = variable_type) + aggregate_profiles(cp, variables = variables, type = "accumulated", variable_type = variable_type, ...) } diff --git a/R/aggregate_profiles.R b/R/aggregate_profiles.R index 32c1d8bd..f63d662a 100644 --- a/R/aggregate_profiles.R +++ b/R/aggregate_profiles.R @@ -11,12 +11,13 @@ #' @param type either \code{partial/conditional/accumulated} for partial dependence, conditional profiles of accumulated local effects #' @param groups a variable name that will be used for grouping. #' By default \code{NULL} which means that no groups shall be calculated +#' @param span smoothing coeffcient, by default 0.25.It's the sd for gaussian kernel #' @param variable_type a character. If \code{numerical} then only numerical variables will be calculated. #' If \code{categorical} then only categorical variables will be calculated. #' #' @references Predictive Models: Visual Exploration, Explanation and Debugging \url{https://pbiecek.github.io/PM_VEE} #' -#' @importFrom stats na.omit quantile weighted.mean +#' @importFrom stats na.omit quantile weighted.mean dnorm #' #' @return an object of the class \code{aggregated_profiles_explainer} #' @@ -85,7 +86,8 @@ aggregate_profiles <- function(x, ..., variable_type = "numerical", groups = NULL, type = "partial", - variables = NULL) { + variables = NULL, + span = 0.25) { check_variable_type(variable_type) check_type(type) @@ -167,12 +169,12 @@ aggregate_profiles <- function(x, ..., "partial_dependency_explainer", "data.frame") } if (type == "conditional") { - aggregated_profiles <- aggregated_profiles_conditional(all_profiles, groups) + aggregated_profiles <- aggregated_profiles_conditional(all_profiles, groups, span = span) class(aggregated_profiles) <- c("aggregated_profiles_explainer", "conditional_dependency_explainer", "data.frame") } if (type == "accumulated") { - aggregated_profiles <- aggregated_profiles_accumulated(all_profiles, groups) + aggregated_profiles <- aggregated_profiles_accumulated(all_profiles, groups, span = span) class(aggregated_profiles) <- c("aggregated_profiles_explainer", "accumulated_dependency_explainer", "data.frame") } @@ -185,7 +187,7 @@ aggregate_profiles <- function(x, ..., } -aggregated_profiles_accumulated <- function(all_profiles, groups = NULL) { +aggregated_profiles_accumulated <- function(all_profiles, groups = NULL, span = 0.25) { observations <- attr(all_profiles, "observations") # just initialisation if (is.numeric(all_profiles$`_x_`)) { @@ -217,10 +219,15 @@ aggregated_profiles_accumulated <- function(all_profiles, groups = NULL) { if (is.numeric(split_profile$`_x_`)) { # for continuous variables we will calculate weighted average - # where weights depends on square distance between points - diffs <- (split_profile$`_orginal_` - split_profile$`_x_`)^2 - diffsd <- sqrt(mean(diffs^2)) - split_profile$`_w_` <- diffs/ifelse(diffsd > 0, diffsd, 1) + # where weights come from gaussian kernel and distance between points + + # scaling factor, range if the range i > 0 + range_x <- diff(range(split_profile$`_x_`)) + if (range_x == 0) range_x <- 1 + + # scalled differences + diffs <- (split_profile$`_orginal_` - split_profile$`_x_`) /range_x + split_profile$`_w_` <- dnorm(diffs, sd = span) } else { # for categorical variables we will calculate weighted average # but weights are 0-1, 1 if it's the same level and 0 otherwise @@ -291,7 +298,7 @@ aggregated_profiles_partial <- function(all_profiles, groups = NULL) { aggregated_profiles } -aggregated_profiles_conditional <- function(all_profiles, groups = NULL) { +aggregated_profiles_conditional <- function(all_profiles, groups = NULL, span = 0.25) { observations <- attr(all_profiles, "observations") # just initialisation @@ -324,10 +331,15 @@ aggregated_profiles_conditional <- function(all_profiles, groups = NULL) { if (is.numeric(split_profile$`_x_`)) { # for continuous variables we will calculate weighted average - # where weights depends on square distance between points - diffs <- (split_profile$`_orginal_` - split_profile$`_x_`)^2 - diffsd <- sqrt(mean(diffs^2)) - split_profile$`_w_` <- diffs/ifelse(diffsd > 0, diffsd, 1) + # where weights come from gaussian kernel and distance between points + + # scaling factor, range if the range i > 0 + range_x <- diff(range(split_profile$`_x_`)) + if (range_x == 0) range_x <- 1 + + # scalled differences + diffs <- (split_profile$`_orginal_` - split_profile$`_x_`) /range_x + split_profile$`_w_` <- dnorm(diffs, sd = span) } else { # for categorical variables we will calculate weighted average # but weights are 0-1, 1 if it's the same level and 0 otherwise diff --git a/R/conditional_dependency.R b/R/conditional_dependency.R index 2a93561e..7abca713 100644 --- a/R/conditional_dependency.R +++ b/R/conditional_dependency.R @@ -119,7 +119,7 @@ conditional_dependency.default <- function(x, variable_splits = variable_splits, label = label, ...) - conditional_dependency.ceteris_paribus_explainer(cp, variables = variables, variable_type = variable_type) + conditional_dependency.ceteris_paribus_explainer(cp, variables = variables, variable_type = variable_type, ...) } diff --git a/man/accumulated_dependency.Rd b/man/accumulated_dependency.Rd index 7650316e..aa979af9 100644 --- a/man/accumulated_dependency.Rd +++ b/man/accumulated_dependency.Rd @@ -9,30 +9,17 @@ \usage{ accumulated_dependency(x, ...) -\method{accumulated_dependency}{explainer}( - x, - variables = NULL, - N = 500, - variable_splits = NULL, - grid_points = 101, - ..., - variable_type = "numerical" -) - -\method{accumulated_dependency}{default}( - x, - data, - predict_function = predict, - label = class(x)[1], - variables = NULL, - N = 500, - variable_splits = NULL, - grid_points = 101, - ..., - variable_type = "numerical" -) - -\method{accumulated_dependency}{ceteris_paribus_explainer}(x, ..., variables = NULL) +\method{accumulated_dependency}{explainer}(x, variables = NULL, + N = 500, variable_splits = NULL, grid_points = 101, ..., + variable_type = "numerical") + +\method{accumulated_dependency}{default}(x, data, + predict_function = predict, label = class(x)[1], variables = NULL, + N = 500, variable_splits = NULL, grid_points = 101, ..., + variable_type = "numerical") + +\method{accumulated_dependency}{ceteris_paribus_explainer}(x, ..., + variables = NULL) } \arguments{ \item{x}{an explainer created with function \code{DALEX::explain()}, an object of the class \code{ceteris_paribus_explainer} diff --git a/man/aggregate_profiles.Rd b/man/aggregate_profiles.Rd index 7d34e734..78ee2ad1 100644 --- a/man/aggregate_profiles.Rd +++ b/man/aggregate_profiles.Rd @@ -4,14 +4,8 @@ \alias{aggregate_profiles} \title{Aggregates Ceteris Paribus Profiles} \usage{ -aggregate_profiles( - x, - ..., - variable_type = "numerical", - groups = NULL, - type = "partial", - variables = NULL -) +aggregate_profiles(x, ..., variable_type = "numerical", groups = NULL, + type = "partial", variables = NULL, span = 0.25) } \arguments{ \item{x}{a ceteris paribus explainer produced with function \code{ceteris_paribus()}} @@ -27,6 +21,8 @@ By default \code{NULL} which means that no groups shall be calculated} \item{type}{either \code{partial/conditional/accumulated} for partial dependence, conditional profiles of accumulated local effects} \item{variables}{if not \code{NULL} then aggregate only for selected \code{variables} will be calculated} + +\item{span}{smoothing coeffcient, by default 0.25.It's the sd for gaussian kernel} } \value{ an object of the class \code{aggregated_profiles_explainer} diff --git a/man/calculate_variable_profile.Rd b/man/calculate_variable_profile.Rd index d825e458..ccdc12cc 100644 --- a/man/calculate_variable_profile.Rd +++ b/man/calculate_variable_profile.Rd @@ -5,21 +5,11 @@ \alias{calculate_variable_profile.default} \title{Internal Function for Individual Variable Profiles} \usage{ -calculate_variable_profile( - data, - variable_splits, - model, - predict_function = predict, - ... -) +calculate_variable_profile(data, variable_splits, model, + predict_function = predict, ...) -\method{calculate_variable_profile}{default}( - data, - variable_splits, - model, - predict_function = predict, - ... -) +\method{calculate_variable_profile}{default}(data, variable_splits, model, + predict_function = predict, ...) } \arguments{ \item{data}{set of observations. Profile will be calculated for every observation (every row)} diff --git a/man/calculate_variable_split.Rd b/man/calculate_variable_split.Rd index f4f920d9..0aec7000 100644 --- a/man/calculate_variable_split.Rd +++ b/man/calculate_variable_split.Rd @@ -5,9 +5,11 @@ \alias{calculate_variable_split.default} \title{Internal Function for Split Points for Selected Variables} \usage{ -calculate_variable_split(data, variables = colnames(data), grid_points = 101) +calculate_variable_split(data, variables = colnames(data), + grid_points = 101) -\method{calculate_variable_split}{default}(data, variables = colnames(data), grid_points = 101) +\method{calculate_variable_split}{default}(data, + variables = colnames(data), grid_points = 101) } \arguments{ \item{data}{validation dataset. Is used to determine distribution of observations.} diff --git a/man/ceteris_paribus.Rd b/man/ceteris_paribus.Rd index 3d3892ff..26988e04 100644 --- a/man/ceteris_paribus.Rd +++ b/man/ceteris_paribus.Rd @@ -8,28 +8,13 @@ \usage{ ceteris_paribus(x, ...) -\method{ceteris_paribus}{explainer}( - x, - new_observation, - y = NULL, - variables = NULL, - variable_splits = NULL, - grid_points = 101, - ... -) - -\method{ceteris_paribus}{default}( - x, - data, - predict_function = predict, - new_observation, - y = NULL, - variables = NULL, - variable_splits = NULL, - grid_points = 101, - label = class(x)[1], - ... -) +\method{ceteris_paribus}{explainer}(x, new_observation, y = NULL, + variables = NULL, variable_splits = NULL, grid_points = 101, ...) + +\method{ceteris_paribus}{default}(x, data, predict_function = predict, + new_observation, y = NULL, variables = NULL, + variable_splits = NULL, grid_points = 101, label = class(x)[1], + ...) } \arguments{ \item{x}{an explainer created with the \code{DALEX::explain()} function, or a model to be explained.} diff --git a/man/ceteris_paribus_2d.Rd b/man/ceteris_paribus_2d.Rd index 417bf5ef..5acc71ea 100644 --- a/man/ceteris_paribus_2d.Rd +++ b/man/ceteris_paribus_2d.Rd @@ -4,7 +4,8 @@ \alias{ceteris_paribus_2d} \title{Ceteris Paribus 2D Plot} \usage{ -ceteris_paribus_2d(explainer, observation, grid_points = 101, variables = NULL) +ceteris_paribus_2d(explainer, observation, grid_points = 101, + variables = NULL) } \arguments{ \item{explainer}{a model to be explained, preprocessed by the \code{DALEX::explain()} function} diff --git a/man/cluster_profiles.Rd b/man/cluster_profiles.Rd index e9686700..c1265f38 100644 --- a/man/cluster_profiles.Rd +++ b/man/cluster_profiles.Rd @@ -4,15 +4,9 @@ \alias{cluster_profiles} \title{Cluster Ceteris Paribus Profiles} \usage{ -cluster_profiles( - x, - ..., - aggregate_function = mean, - variable_type = "numerical", - center = FALSE, - k = 3, - variables = NULL -) +cluster_profiles(x, ..., aggregate_function = mean, + variable_type = "numerical", center = FALSE, k = 3, + variables = NULL) } \arguments{ \item{x}{a ceteris paribus explainer produced with function \code{ceteris_paribus()}} diff --git a/man/conditional_dependency.Rd b/man/conditional_dependency.Rd index 6cfb6dd7..2d953552 100644 --- a/man/conditional_dependency.Rd +++ b/man/conditional_dependency.Rd @@ -10,30 +10,17 @@ \usage{ conditional_dependency(x, ...) -\method{conditional_dependency}{explainer}( - x, - variables = NULL, - N = 500, - variable_splits = NULL, - grid_points = 101, - ..., - variable_type = "numerical" -) - -\method{conditional_dependency}{default}( - x, - data, - predict_function = predict, - label = class(x)[1], - variables = NULL, - N = 500, - variable_splits = NULL, - grid_points = 101, - ..., - variable_type = "numerical" -) - -\method{conditional_dependency}{ceteris_paribus_explainer}(x, ..., variables = NULL) +\method{conditional_dependency}{explainer}(x, variables = NULL, + N = 500, variable_splits = NULL, grid_points = 101, ..., + variable_type = "numerical") + +\method{conditional_dependency}{default}(x, data, + predict_function = predict, label = class(x)[1], variables = NULL, + N = 500, variable_splits = NULL, grid_points = 101, ..., + variable_type = "numerical") + +\method{conditional_dependency}{ceteris_paribus_explainer}(x, ..., + variables = NULL) local_dependency(x, ...) } diff --git a/man/describe.Rd b/man/describe.Rd index 28e17509..70f3a20e 100644 --- a/man/describe.Rd +++ b/man/describe.Rd @@ -8,29 +8,18 @@ \alias{describe.feature_importance_explainer} \title{Natural language description of feature importance explainer} \usage{ -\method{describe}{partial_dependency_explainer}( - x, - nonsignificance_treshold = 0.15, - ..., - display_values = FALSE, - display_numbers = FALSE, - variables = NULL, - label = "prediction" -) +\method{describe}{partial_dependency_explainer}(x, + nonsignificance_treshold = 0.15, ..., display_values = FALSE, + display_numbers = FALSE, variables = NULL, label = "prediction") describe(x, ...) -\method{describe}{ceteris_paribus_explainer}( - x, - nonsignificance_treshold = 0.15, - ..., - display_values = FALSE, - display_numbers = FALSE, - variables = NULL, - label = "prediction" -) - -\method{describe}{feature_importance_explainer}(x, nonsignificance_treshold = 0.15, ...) +\method{describe}{ceteris_paribus_explainer}(x, + nonsignificance_treshold = 0.15, ..., display_values = FALSE, + display_numbers = FALSE, variables = NULL, label = "prediction") + +\method{describe}{feature_importance_explainer}(x, + nonsignificance_treshold = 0.15, ...) } \arguments{ \item{x}{a ceteris paribus explanation produced with function \code{ceteris_paribus()}} diff --git a/man/feature_importance.Rd b/man/feature_importance.Rd index f9682b08..245f9298 100644 --- a/man/feature_importance.Rd +++ b/man/feature_importance.Rd @@ -8,34 +8,17 @@ \usage{ feature_importance(x, ...) -\method{feature_importance}{explainer}( - x, - loss_function = loss_root_mean_square, - ..., - type = c("raw", "ratio", "difference"), - n_sample = NULL, - B = 1, - keep_raw_permutations = NULL, - variables = NULL, - variable_groups = NULL, - label = NULL -) - -\method{feature_importance}{default}( - x, - data, - y, - predict_function = predict, - loss_function = loss_root_mean_square, - ..., - label = class(x)[1], - type = c("raw", "ratio", "difference"), - n_sample = NULL, - B = 1, - keep_raw_permutations = NULL, - variables = NULL, - variable_groups = NULL -) +\method{feature_importance}{explainer}(x, + loss_function = loss_root_mean_square, ..., type = c("raw", "ratio", + "difference"), n_sample = NULL, B = 1, + keep_raw_permutations = NULL, variables = NULL, + variable_groups = NULL, label = NULL) + +\method{feature_importance}{default}(x, data, y, + predict_function = predict, loss_function = loss_root_mean_square, + ..., label = class(x)[1], type = c("raw", "ratio", "difference"), + n_sample = NULL, B = 1, keep_raw_permutations = NULL, + variables = NULL, variable_groups = NULL) } \arguments{ \item{x}{an explainer created with function \code{DALEX::explain()}, or a model to be explained.} diff --git a/man/partial_dependency.Rd b/man/partial_dependency.Rd index 5b10f2d0..01e2ed28 100644 --- a/man/partial_dependency.Rd +++ b/man/partial_dependency.Rd @@ -9,30 +9,16 @@ \usage{ partial_dependency(x, ...) -\method{partial_dependency}{explainer}( - x, - variables = NULL, - N = 500, - variable_splits = NULL, - grid_points = 101, - ..., - variable_type = "numerical" -) - -\method{partial_dependency}{default}( - x, - data, - predict_function = predict, - label = class(x)[1], - variables = NULL, - grid_points = 101, - variable_splits = NULL, - N = 500, - ..., - variable_type = "numerical" -) - -\method{partial_dependency}{ceteris_paribus_explainer}(x, ..., variables = NULL) +\method{partial_dependency}{explainer}(x, variables = NULL, N = 500, + variable_splits = NULL, grid_points = 101, ..., + variable_type = "numerical") + +\method{partial_dependency}{default}(x, data, predict_function = predict, + label = class(x)[1], variables = NULL, grid_points = 101, + variable_splits = NULL, N = 500, ..., variable_type = "numerical") + +\method{partial_dependency}{ceteris_paribus_explainer}(x, ..., + variables = NULL) } \arguments{ \item{x}{an explainer created with function \code{DALEX::explain()}, an object of the class \code{ceteris_paribus_explainer} or diff --git a/man/plot.aggregated_profiles_explainer.Rd b/man/plot.aggregated_profiles_explainer.Rd index dc0b275b..b8c31620 100644 --- a/man/plot.aggregated_profiles_explainer.Rd +++ b/man/plot.aggregated_profiles_explainer.Rd @@ -4,15 +4,9 @@ \alias{plot.aggregated_profiles_explainer} \title{Plots Aggregated Profiles} \usage{ -\method{plot}{aggregated_profiles_explainer}( - x, - ..., - size = 1, - alpha = 1, - color = "_label_", - facet_ncol = NULL, - variables = NULL -) +\method{plot}{aggregated_profiles_explainer}(x, ..., size = 1, + alpha = 1, color = "_label_", facet_ncol = NULL, + variables = NULL) } \arguments{ \item{x}{a ceteris paribus explainer produced with function \code{aggregate_profiles()}} diff --git a/man/plot.ceteris_paribus_2d_explainer.Rd b/man/plot.ceteris_paribus_2d_explainer.Rd index e7e620cc..13115633 100644 --- a/man/plot.ceteris_paribus_2d_explainer.Rd +++ b/man/plot.ceteris_paribus_2d_explainer.Rd @@ -4,17 +4,9 @@ \alias{plot.ceteris_paribus_2d_explainer} \title{Plot Ceteris Paribus 2D Explanations} \usage{ -\method{plot}{ceteris_paribus_2d_explainer}( - x, - ..., - facet_ncol = NULL, - add_raster = TRUE, - add_contour = TRUE, - bins = 3, - add_observation = TRUE, - pch = "+", - size = 6 -) +\method{plot}{ceteris_paribus_2d_explainer}(x, ..., facet_ncol = NULL, + add_raster = TRUE, add_contour = TRUE, bins = 3, + add_observation = TRUE, pch = "+", size = 6) } \arguments{ \item{x}{a ceteris paribus explainer produced with the \code{ceteris_paribus_2d()} function} diff --git a/man/plot.ceteris_paribus_explainer.Rd b/man/plot.ceteris_paribus_explainer.Rd index 202c8f7a..4864b00c 100644 --- a/man/plot.ceteris_paribus_explainer.Rd +++ b/man/plot.ceteris_paribus_explainer.Rd @@ -4,16 +4,9 @@ \alias{plot.ceteris_paribus_explainer} \title{Plots Ceteris Paribus Profiles} \usage{ -\method{plot}{ceteris_paribus_explainer}( - x, - ..., - size = 1, - alpha = 1, - color = "#46bac2", - variable_type = "numerical", - facet_ncol = NULL, - variables = NULL -) +\method{plot}{ceteris_paribus_explainer}(x, ..., size = 1, alpha = 1, + color = "#46bac2", variable_type = "numerical", facet_ncol = NULL, + variables = NULL) } \arguments{ \item{x}{a ceteris paribus explainer produced with function \code{ceteris_paribus()}} diff --git a/man/plot.feature_importance_explainer.Rd b/man/plot.feature_importance_explainer.Rd index 5b2c0051..daaaa95c 100644 --- a/man/plot.feature_importance_explainer.Rd +++ b/man/plot.feature_importance_explainer.Rd @@ -4,7 +4,8 @@ \alias{plot.feature_importance_explainer} \title{Plots Feature Importance} \usage{ -\method{plot}{feature_importance_explainer}(x, ..., max_vars = NULL, bar_width = 10) +\method{plot}{feature_importance_explainer}(x, ..., max_vars = NULL, + bar_width = 10) } \arguments{ \item{x}{a feature importance explainer produced with the \code{feature_importance()} function} diff --git a/man/plotD3_aggregated_profiles.Rd b/man/plotD3_aggregated_profiles.Rd index 5fa5652c..c1eb7275 100644 --- a/man/plotD3_aggregated_profiles.Rd +++ b/man/plotD3_aggregated_profiles.Rd @@ -4,18 +4,10 @@ \alias{plotD3.aggregated_profiles_explainer} \title{Plots Aggregated Ceteris Paribus Profiles in D3 with r2d3 Package.} \usage{ -\method{plotD3}{aggregated_profiles_explainer}( - x, - ..., - size = 2, - alpha = 1, - color = "#46bac2", - facet_ncol = 2, - scale_plot = FALSE, - variables = NULL, - chart_title = "Aggregated Profiles", - label_margin = 60 -) +\method{plotD3}{aggregated_profiles_explainer}(x, ..., size = 2, + alpha = 1, color = "#46bac2", facet_ncol = 2, scale_plot = FALSE, + variables = NULL, chart_title = "Aggregated Profiles", + label_margin = 60) } \arguments{ \item{x}{a aggregated profiles explainer produced with function \code{aggregate_profiles()}} diff --git a/man/plotD3_ceteris_paribus.Rd b/man/plotD3_ceteris_paribus.Rd index 007f84ad..9b25d88f 100644 --- a/man/plotD3_ceteris_paribus.Rd +++ b/man/plotD3_ceteris_paribus.Rd @@ -7,21 +7,11 @@ \usage{ plotD3(x, ...) -\method{plotD3}{ceteris_paribus_explainer}( - x, - ..., - size = 2, - alpha = 1, - color = "#46bac2", - variable_type = "numerical", - facet_ncol = 2, - scale_plot = FALSE, - variables = NULL, - chart_title = "Ceteris Paribus Profiles", - label_margin = 60, - show_observations = TRUE, - show_rugs = TRUE -) +\method{plotD3}{ceteris_paribus_explainer}(x, ..., size = 2, alpha = 1, + color = "#46bac2", variable_type = "numerical", facet_ncol = 2, + scale_plot = FALSE, variables = NULL, + chart_title = "Ceteris Paribus Profiles", label_margin = 60, + show_observations = TRUE, show_rugs = TRUE) } \arguments{ \item{x}{a ceteris paribus explainer produced with function \code{ceteris_paribus()}} diff --git a/man/plotD3_feature_importance.Rd b/man/plotD3_feature_importance.Rd index 0ad801c9..4fe32cd3 100644 --- a/man/plotD3_feature_importance.Rd +++ b/man/plotD3_feature_importance.Rd @@ -4,16 +4,9 @@ \alias{plotD3.feature_importance_explainer} \title{Plot Feature Importance Objects in D3 with r2d3 Package.} \usage{ -\method{plotD3}{feature_importance_explainer}( - x, - ..., - max_vars = NULL, - bar_width = 12, - split = "model", - scale_height = FALSE, - margin = 0.15, - chart_title = "Feature importance" -) +\method{plotD3}{feature_importance_explainer}(x, ..., max_vars = NULL, + bar_width = 12, split = "model", scale_height = FALSE, + margin = 0.15, chart_title = "Feature importance") } \arguments{ \item{x}{a feature importance explainer produced with the \code{feature_importance()} function} diff --git a/man/select_neighbours.Rd b/man/select_neighbours.Rd index 268e47f1..09da4791 100644 --- a/man/select_neighbours.Rd +++ b/man/select_neighbours.Rd @@ -4,14 +4,8 @@ \alias{select_neighbours} \title{Select Subset of Rows Closest to a Specified Observation} \usage{ -select_neighbours( - observation, - data, - variables = NULL, - distance = gower::gower_dist, - n = 20, - frac = NULL -) +select_neighbours(observation, data, variables = NULL, + distance = gower::gower_dist, n = 20, frac = NULL) } \arguments{ \item{observation}{single observation} diff --git a/man/show_aggregated_profiles.Rd b/man/show_aggregated_profiles.Rd index 9cb7cefa..7f0a4bf9 100644 --- a/man/show_aggregated_profiles.Rd +++ b/man/show_aggregated_profiles.Rd @@ -4,14 +4,8 @@ \alias{show_aggregated_profiles} \title{Adds a Layer with Aggregated Profiles} \usage{ -show_aggregated_profiles( - x, - ..., - size = 0.5, - alpha = 1, - color = "#371ea3", - variables = NULL -) +show_aggregated_profiles(x, ..., size = 0.5, alpha = 1, + color = "#371ea3", variables = NULL) } \arguments{ \item{x}{a ceteris paribus explainer produced with function \code{ceteris_paribus()}} diff --git a/man/show_observations.Rd b/man/show_observations.Rd index 84be6f31..d4a77977 100644 --- a/man/show_observations.Rd +++ b/man/show_observations.Rd @@ -4,15 +4,8 @@ \alias{show_observations} \title{Adds a Layer with Observations to a Profile Plot} \usage{ -show_observations( - x, - ..., - size = 2, - alpha = 1, - color = "#371ea3", - variable_type = "numerical", - variables = NULL -) +show_observations(x, ..., size = 2, alpha = 1, color = "#371ea3", + variable_type = "numerical", variables = NULL) } \arguments{ \item{x}{a ceteris paribus explainer produced with function \code{ceteris_paribus()}} diff --git a/man/show_profiles.Rd b/man/show_profiles.Rd index c62a2bf7..e811dd8e 100644 --- a/man/show_profiles.Rd +++ b/man/show_profiles.Rd @@ -4,14 +4,8 @@ \alias{show_profiles} \title{Adds a Layer with Profiles} \usage{ -show_profiles( - x, - ..., - size = 0.5, - alpha = 1, - color = "#371ea3", - variables = NULL -) +show_profiles(x, ..., size = 0.5, alpha = 1, color = "#371ea3", + variables = NULL) } \arguments{ \item{x}{a ceteris paribus explainer produced with function \code{ceteris_paribus()}} diff --git a/man/show_residuals.Rd b/man/show_residuals.Rd index 56dd5243..da4e70cb 100644 --- a/man/show_residuals.Rd +++ b/man/show_residuals.Rd @@ -4,14 +4,8 @@ \alias{show_residuals} \title{Adds a Layer with Residuals to a Profile Plot} \usage{ -show_residuals( - x, - ..., - size = 0.75, - alpha = 1, - color = c(`TRUE` = "#371ea3", `FALSE` = "#f05a71"), - variables = NULL -) +show_residuals(x, ..., size = 0.75, alpha = 1, color = c(`TRUE` = + "#371ea3", `FALSE` = "#f05a71"), variables = NULL) } \arguments{ \item{x}{a ceteris paribus explainer produced with function \code{ceteris_paribus()}. diff --git a/man/show_rugs.Rd b/man/show_rugs.Rd index 1a0ba241..e5a83476 100644 --- a/man/show_rugs.Rd +++ b/man/show_rugs.Rd @@ -4,16 +4,8 @@ \alias{show_rugs} \title{Adds a Layer with Rugs to a Profile Plot} \usage{ -show_rugs( - x, - ..., - size = 0.5, - alpha = 1, - color = "#371ea3", - variable_type = "numerical", - sides = "b", - variables = NULL -) +show_rugs(x, ..., size = 0.5, alpha = 1, color = "#371ea3", + variable_type = "numerical", sides = "b", variables = NULL) } \arguments{ \item{x}{a ceteris paribus explainer produced with function \code{ceteris_paribus()}}