plot_cluster_errors#

er_evaluation.plot_cluster_errors(prediction, reference, x='expected_relative_extra', y='expected_relative_missing', groupby=None, weights=None, opacity=0.5, **kwargs)[source]#

Scatter plot of two cluster-wise error metrics.

Metrics that can be plotted are:

Parameters:
  • prediction (Series) – Predicted clustering.

  • reference (Series) – Reference clustering.

  • x (str, optional) – x-axis metric to plot. Defaults to “expected_relative_extra”.

  • y (str, optional) – y-axis metric to plot. Defaults to “expected_relative_missing”.

  • groupby (Series, optional) – Optional Series with grouping values (corresponding to color elements). Should be indexed by cluster identifier, with values corresponding to group assignment.

  • weights (Series, optional) – Optional Series with cluster weights. Should be indexed by cluster identifier, with values corresponding to cluster weight. Can also be set to the string “cluster_size” for clusters sampled with probability proportional to size.

  • opacity (float, optional) – Opacity. Defaults to 0.5.

  • **kwargs (optional) – Additional arguments to pass to plotly express for plot creation.

Returns:

plotly Figure

Note

Weights are not accounted for in the marginal histograms.