attribench.plot.ClusterPlot

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

Bases: Plot

Clustermap of the median values of the metrics and methods. Allows the user to see which metrics and/or methods behave similarly.

The plot is shown as a heatmap, with each cell corresponding to the median metric value for a given method and metric. The heatmap is clustered using hierarchical clustering, with the distance between two methods being the correlation between their median metric values. The distance between two metrics is computed in the same way. The clustering is performed using single linkage.

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(figsize=(7, 7))[source]

Render the plot. TODO add more parameters for font size, title, etc.

Parameters:
figsizeTuple[int, int], optional

Figure size, by default (7, 7)

Return type:

Figure