responsibility ============== .. py:module:: responsibility .. autoapi-nested-parse:: calculate causal responsibility Functions --------- .. autoapisummary:: responsibility.subbox responsibility.update_depth_reached responsibility.prune responsibility.causal_explanation Module Contents --------------- .. py:function:: 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 @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 .. py:function:: 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 .. py:function:: 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 .. py:function:: 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