shapr0.2.2 package

Prediction Explanation with Dependence-Aware Shapley Values

aicc_full_cpp

AICc formula for several sets, alternative definition

aicc_full_single_cpp

Temp-function for computing the full AICc with several X's etc

apply_dummies

Apply dummy variables - this is an internal function intended only to ...

check_features

Checks that two extracted feature lists have exactly the same properti...

correction_matrix_cpp

correction term with trace_input in AICc formula

create_ctree

Make all conditional inference trees

explain

Explain the output of machine learning models with more accurately est...

feature_combinations

Define feature combinations, and fetch additional information about ea...

feature_matrix_cpp

Get feature matrix

gaussian_transform

Transforms a sample to standardized normal distribution

gaussian_transform_separate

Transforms new data to standardized normal (dimension 1) based on othe...

get_data_specs

Fetches feature information from a given data set

get_list_approaches

Helper function used in explain.combined

get_model_specs

Fetches feature information from a given model object

get_supported_models

Provides a data.table with the supported models

hat_matrix_cpp

Computing single H matrix in AICc-function using the Mahalanobis dista...

inv_gaussian_transform

Transforms new data to a standardized normal distribution

mahalanobis_distance_cpp

(Generalized) Mahalanobis distance

make_dummies

Initiate the making of dummy variables

model_checker

Check that the type of model is supported by the explanation method

observation_impute

Generate permutations of training data using test observations

observation_impute_cpp

Get imputed data

plot.shapr

Plot of the Shapley value explanations

predict_model

Generate predictions for different model classes

prediction

Calculate Shapley weights for test data

prepare_data

Generate data used for predictions

preprocess_data

Process (check and update) data according to specified feature list

rss_cpp

sigma_hat_sq-function

sample_combinations

Helper function to sample a combination of training and testing rows, ...

sample_copula

Sample conditional variables using the Gaussian copula approach

sample_ctree

Sample ctree variables from a given conditional inference tree

sample_gaussian

Sample conditional Gaussian variables

shapley_weights

Calculate Shapley weight

shapr

Create an explainer object with Shapley weights for test data.

update_data

Updates data by reference according to the updater argument.

weight_matrix

Calculate weighted matrix

weight_matrix_cpp

Calculate weight 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 the method described in Aas, Jullum and Løland (2019) <arXiv:1903.10464>, which accounts for any feature dependence, and thereby produces more accurate estimates of the true Shapley values.

  • Maintainer: Martin Jullum
  • License: MIT + file LICENSE
  • Last published: 2023-05-04