Prediction Explanation with Dependence-Aware Shapley Values
Additional setup for regression-based methods
AICc formula for several sets, alternative definition
Temp-function for computing the full AICc with several X's etc
Appends the new vS_list to the prev vS_list
A torch::nn_module()
Representing a categorical_to_one_hot_layer
Check that all explicands has at least one valid MC sample in causal S...
Checks the convergence according to the convergence threshold
Check that the group parameter has the right form and content
Function that checks the verbose parameter
Printing messages in compute_vS with cli
Printing messages in iterative procedure with cli
Printing startup messages with cli
Get coalition matrix
Computes the the Shapley values and their standard deviation given the...
Mean Squared Error of the Contribution Function v(S)
Compute shapley values
Gathers and computes the timing of the different parts of the explain ...
Computes v(S)
for all features subsets S
.
Convert feature names into feature indices
Correction term with trace_input in AICc formula
Define coalitions, and fetch additional information about each unique ...
Build all the conditional inference trees
Create marginal categorical data for causal Shapley values
Generate marginal Gaussian data using Cholesky decomposition
Function that samples data from the empirical marginal training distri...
Exported documentation helper function.
Unexported documentation helper function.
Get table with all (exact) coalitions
Explain a forecast from time series models with dependence-aware (cond...
Explain the output of machine learning models with dependence-aware (c...
Gathers the final output to create the explanation object
A torch::nn_module()
Representing a gauss_cat_loss
A torch::nn_module()
Representing a gauss_cat_parameters
A torch::nn_module()
Representing a gauss_cat_sampler_most_likely
A torch::nn_module()
Representing a gauss_cat_sampler_random
Transforms new data to standardized normal (dimension 1) based on othe...
Transforms a sample to standardized normal distribution
get_cov_mat
Set up data for explain_forecast
Fetches feature information from a given data set
Gets the default values for the extra computation arguments
This includes both extra parameters and other objects
Gets the feature specifications form the model
Function to specify arguments of the iterative estimation procedure
Get the number of coalitions that respects the causal ordering
Fetches feature information from natively supported models
get_mu_vec
Gets the default values for the output arguments
Get predict_model function
Get the steps for generating MC samples for coalitions following a cau...
Gets the implemented approaches
Provides a data.table with the supported models
Get all coalitions satisfying the causal ordering
Set up user provided groups for explanation in a forecast model.
Computing single H matrix in AICc-function using the Mahalanobis dista...
Transforms new data to a standardized normal distribution
Lag a matrix of variables a specific number of lags for each variables...
(Generalized) Mahalanobis distance
Missing Completely at Random (MCAR) Mask Generator
A torch::nn_module()
Representing a Memory Layer
Check that the type of model is supported by the native implementation...
Get imputed data
Generate permutations of training data using test observations
Sampling Paired Observations
Plots of the MSEv Evaluation Criterion
Shapley value bar plots for several explanation objects
Plot the training VLB and validation IWAE for vaeac
models
Plot Pairwise Plots for Imputed and True Data
Plot of the Shapley value explanations
Generate predictions for input data with specified model
Generate data used for predictions and Monte Carlo integration for cau...
Generate (Gaussian) Copula MC samples for the causal setup with a sing...
Generate (Gaussian) Copula MC samples
Generate Gaussian MC samples for the causal setup with a single MC sam...
Generate Gaussian MC samples
Compute the conditional probabilities for a single coalition for the c...
Generate data used for predictions and Monte Carlo integration
Prepares the next iteration of the iterative sampling algorithm
Prints iterative information
Print method for shapr objects
Treat factors as numeric values
Compute the quantiles using quantile type seven
Set up exogenous regressors for explanation in a forecast model.
Check that needed libraries are installed
Check regression parameters
Check regression.recipe_func
Check the regression.surrogate_n_comb
parameter
Check the parameters that are sent to rsample::vfold_cv()
Produce message about which batch prepare_data is working on
Convert the string into an R object
Get if model is to be tuned
Get the predicted responses
Augment the training data and the explicands
Train a tidymodels model via workflows
Auxiliary function for the vignettes
Function for computing sigma_hat_sq
Get table with sampled coalitions
We here return a vector of strings/characters, i.e., a CharacterVector...
Helper function to sample a combination of training and testing rows, ...
Sample ctree variables from a given conditional inference tree
Saves the intermediate results to disk
Set up the framework for the chosen approach
check_setup
Set up the kernelSHAP framework
Calculate Shapley weight
shapr: Prediction Explanation with Dependence-Aware Shapley Values
A torch::nn_module()
Representing a skip connection
A torch::nn_module()
Representing a specified_masks_mask_generator
A torch::nn_module()
Representing a specified_prob_mask_generator
Model testing function
Cleans out certain output arguments to allow perfect reproducibility o...
Creates Categorical Distributions
Function that checks the provided activation function
Function that checks for access to CUDA
Function that checks provided epoch arguments
Check vaeac.extra_parameters list
Function that checks logicals
Function that checks the specified masking scheme
Function that checks that the masking ratio argument is valid
Function that calls all vaeac parameters check functions
Function that checks positive integers
Function that checks positive numerics
Function that checks probabilities
Function that checks that the save folder exists and for a valid file ...
Function that gives a warning about disk usage
Function that checks for valid vaeac
model name
Function that checks the feature names of data and vaeac
model
Compute Featurewise Means and Standard Deviations
Dataset used by the vaeac
model
Extends Incomplete Batches by Sampling Extra Data from Dataloader
Function that extracts additional objects from the environment to the ...
Function to set up data loaders and save file names
Extract the Training VLB and Validation IWAE from a list of explanatio...
Function to specify the extra parameters in the vaeac
model
Function that extracts the state list objects from the environment
Function that determines which mask generator to use
Function to load a vaeac
model and set it in the right state and mod...
Function to get string of values with specific number of decimals
Function to create the optimizer used to train vaeac
Function that creates the save file names for the vaeac
model
Compute the Importance Sampling Estimator (Validation Error)
Function to extend the explicands and apply all relevant masks/coaliti...
Impute Missing Values Using Vaeac
Compute the KL Divergence Between Two Gaussian Distributions.
Creates Normal Distributions
Normalize mixed data for vaeac
Postprocess Data Generated by a vaeac Model
Preprocess Data for the vaeac approach
Function to printout a training summary for the vaeac
model
Function that saves the state list and the current save state of the `...
Function used to train a vaeac
model
Continue to Train the vaeac Model
Train the Vaeac Model
Move vaeac
parameters to correct location
Function that checks and adds a pre-trained vaeac
model
Initializing a vaeac model
Calculate weight matrix
Calculate weighted matrix
Complex machine learning models are often hard to interpret. However, in many situations it is crucial to understand and explain why a model made a specific prediction. Shapley values is the only method for such prediction explanation framework with a solid theoretical foundation. Previously known methods for estimating the Shapley values do, however, assume feature independence. This package implements methods which accounts for any feature dependence, and thereby produces more accurate estimates of the true Shapley values. An accompanying 'Python' wrapper ('shaprpy') is available through the GitHub repository.
Useful links