Extract Components from a Shapr Object
Usage
get_results(
x,
what = c("calling_function", "proglang", "approach", "shapley_est", "shapley_sd",
"pred_explain", "MSEv", "MSEv_explicand", "MSEv_coalition", "iterative_info",
"iterative_shapley_est", "iterative_shapley_sd", "saving_path", "timing_summary",
"timing_details", "parameters", "x_train", "x_explain", "dt_vS", "dt_samp_for_vS",
"dt_used_coalitions", "dt_valid_causal_coalitions", "dt_coal_samp_info"),
...
)Arguments
- x
A
shaprobject- what
Character vector specifying one or more components to extract. Options: "calling_function", "proglang", "approach", "shapley_est", "shapley_sd", "pred_explain", "MSEv", "MSEv_explicand", "MSEv_coalition", "iterative_info", "iterative_shapley_est", "iterative_shapley_sd", "saving_path", "timing_summary", "timing_details", "parameters", "x_train", "x_explain", "dt_vS", "dt_samp_for_vS", "dt_used_coalitions", "dt_valid_causal_coalitions", "dt_coal_samp_info". The default is to return all components. See details for what each component contains.
- ...
Not used
Value
If a single component is requested, returns that object. If multiple are requested, returns a named list.
Details
The function extracts a full suite of information related to the computation of the Shapley values from
a shapr object.
The allowed characters in what provides information as follows:
calling_functionName of function called to create the
shaprobject, (explain()orexplain_forecast()).proglangProgramming language used to initiate the computations (
RorPython).approachApproach used to estimate the conditional expectations.
shapley_estdata.table with the estimated Shapley values.
shapley_sddata.table with the standard deviation of the Shapley values reflecting the uncertainty in the coalition sampling part of the kernelSHAP procedure.
pred_explainNumeric vector with the predictions for the explained observations.
MSEv/MSEv_explicand/MSEv_coalitionData.tables with MSEv evaluation criterion values overall/ per explicand/per coalition. Smaller values indicate better estimates of
v(S). See the MSEv evaluation section in the general usage vignette for details.iterative_infoData.table with information about the iterative estimation procedure.
iterative_shapley_est/iterative_shapley_sdData.tables with the estimated Shapley values/their standard deviation for each iteration (when using the iterative estimation procedure).
saving_pathCharacter string with the path where the (temporary) results are saved.
timing_summaryData.table with one row and three columns:
init_timeandend_timegive the time stamps for the start and end of the computation, respectively, whiletotal_time_secsgives the total time in seconds for the full computation.timing_detailsList containing timing information for the different parts of the computation.
summarycontains the information fromtiming_summary.overall_timing_secsgives the time spent on the different parts of the explanation computation.main_computation_timing_secsfurther decomposes the main computation time into the different parts of the computation for each iteration of the iterative estimation routine, if used.parametersList with the parameters used in the computation.
x_train/x_explainData.tables with the training data used in the computation/observations to explain.
dt_vSData.table with the contribution function (
v(S)) estimates for each coalition.dt_samp_for_vSData.table with the samples used in the Monte Carlo estimation of the contribution function (
v(S)). This is only available ifoutput_args_default$keep_samp_for_vS = TRUE(defaults to FALSE) inexplain().dt_used_coalitionsData.table with an overview of the coalitions used in the computation.
dt_valid_causal_coalitionsData.table with the valid causal coalitions used in the computation.
dt_coal_samp_infoData.table with information related to the coalition sampling procedure being used.
Note that the summary.shapr() function provides a nicely formatted printout with the most important
information, to then invisibly return the output of the present function.
The print.shapr() allows direct printing of the main results.