attribench.plot.InterMetricCorrelationPlot

class attribench.plot.InterMetricCorrelationPlot(dfs)[source]

Bases: Plot

Heatmap showing Spearman correlations between metrics.

Parameters:
dfsDict[str, Tuple[pd.DataFrame, bool]]

A dictionary mapping metric names to tuples of dataframes and booleans. The boolean indicates whether higher values of the metric are better (True) or not (False). The dataframes should have the same columns, which are the names of the methods.

Methods

render

Render the plot.

render(title=None, figsize=(20, 20), fontsize=None, annot=False)[source]

Render the plot.

Parameters:
titlestr | None, optional

Title of the figure, by default None

figsizeTuple[int, int], optional

Size of the figure, by default (20, 20)

fontsizeint | None, optional

Font size of x and y axis ticks, by default None

annotbool, optional

Whether to annotate the heatmap with the correlation values, by default False

Returns:
Figure

The rendered Matplotlib figure.

Return type:

Figure