responsibility

calculate causal responsibility

Functions

subbox(tree, name, max_depth, min_size, mode[, r_map])

Split a box into 4 contiguous children or None if no possible.

update_depth_reached(depth_reached, passing)

Update the max tree depth reached.

prune(mutants[, technique, keep])

Reduce the search queue to improve both efficiency and (possibly) result quality.

causal_explanation(process, data, args, prediction_func)

Calculate causal responsiblity.

Module Contents

responsibility.subbox(tree, name, max_depth, min_size, mode, r_map=None)

Split a box into 4 contiguous children or None if no possible.

@param tree: a search tree @param name: a node name to search for in <tree> @param max_depth: tree depth limit for new children @param min_size: minimum new child size @param mode: spectral, tabular, RGB, L or voxel @param r_map=None: responsibility map

@return None or new children

responsibility.update_depth_reached(depth_reached, passing)

Update the max tree depth reached.

@param depth_reached: current max_depth @param passing: a list of passing Mutant

@return int

responsibility.prune(mutants, technique=Queue.Intersection, keep=None)

Reduce the search queue to improve both efficiency and (possibly) result quality.

@param mutants: a list of passing Mutant objects @param technique: a Queue enum @param keep=None: how many items to keep in the queue, all if keep is None

@return a list of mutants of length <= keep

Parameters:

mutants (List[rex_xai.mutants.mutant.Mutant])

responsibility.causal_explanation(process, data, args, prediction_func, current_map=None)

Calculate causal responsiblity.

@param process: an integer value @param data: a Data object @param args: a CausalArgs object @param prediction_func: a higher order

function that calls a model and return a Prediction object

Parameters:
  • data (rex_xai.input.input_data.Data)

  • args (rex_xai.input.config.CausalArgs)