gsnn.gsnn.interpret.plot_explanation_graph

Functions

adjust_label_positions(pos, labels[, ...])

Adjust label positions to avoid overlap using bounding boxes.

bounding_box_overlap(box1, box2)

Check if two bounding boxes overlap.

plot_explanation_graph(res[, threshold, ...])

plot_hairball(res[, save, figsize, fontsize])

gsnn.gsnn.interpret.plot_explanation_graph.adjust_label_positions(pos, labels, scale_factor=300, shift_margin=1, hy=15, max_iters=1000)[source]

Adjust label positions to avoid overlap using bounding boxes.

Parameters: - pos: dict, node positions - labels: dict, node labels - scale_factor: float, factor to scale bounding box based on label length - shift_margin: float, margin to shift labels up/down to resolve overlap

Returns: - new_pos: dict, adjusted label positions

gsnn.gsnn.interpret.plot_explanation_graph.bounding_box_overlap(box1, box2)[source]

Check if two bounding boxes overlap.

gsnn.gsnn.interpret.plot_explanation_graph.plot_explanation_graph(res, threshold=0.5, num_edges=None, save=None, figsize=(10, 10), fontsize=8, node_size=25, extdata_path='../extdata/')[source]
gsnn.gsnn.interpret.plot_explanation_graph.plot_hairball(res, save=None, figsize=(10, 10), fontsize=12)[source]