sample_coalition_table: Get table with sampled coalitions

sample_coalition_tableR Documentation

Get table with sampled coalitions

Description

Get table with sampled coalitions

Usage

sample_coalition_table(
  m,
  n_coalitions = 200,
  weight_zero_m = 10^6,
  paired_shap_sampling = TRUE,
  prev_coal_samples = NULL,
  prev_coal_samples_n_unique = NULL,
  kernelSHAP_reweighting,
  n_samps_scale = 10,
  dt_valid_causal_coalitions = NULL
)

Arguments

m

Positive integer. Total number of features/groups.

n_coalitions

Positive integer. Note that if exact = TRUE, n_coalitions is ignored.

weight_zero_m

Numeric. The value to use as a replacement for infinite coalition weights when doing numerical operations.

paired_shap_sampling

Logical. Whether to do paired sampling of coalitions.

prev_coal_samples

Character vector. A vector of previously sampled coalitions as characters. Each string contains a coalition and the feature indices in the coalition is separated by a space. For example, "1 5 8" is a coalition with features 1, 5, and 8.

prev_coal_samples_n_unique

Positive integer. The number of unique coalitions in prev_coal_samples. This is a separate argument to avoid recomputing the number unnecessarily.

n_samps_scale

Positive integer. Integer that scales the number of coalitions n_coalitions to sample as sampling is cheap, while checking for n_coalitions unique coalitions is expensive, thus we over sample the number of coalitions by a factor of n_samps_scale and determine when we have n_coalitions unique coalitions and only use the coalitions up to this point and throw away the remaining coalitions.

dt_valid_causal_coalitions

data.table. Only applicable for asymmetric Shapley values explanations, and is NULL for symmetric Shapley values. The data.table contains information about the coalitions that respects the causal ordering.


shapr documentation built on April 4, 2025, 12:18 a.m.