plot_cluster_errors#
- er_evaluation.plots.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:
expected_extra (see
er_evaluation.error_analysis.expected_extra())expected_relative_extra (see
er_evaluation.error_analysis.expected_relative_extra())expected_missing (see
er_evaluation.error_analysis.expected_missing())expected_relative_missing (see
er_evaluation.error_analysis.expected_relative_missing())error_indicator (see
er_evaluation.error_analysis.error_indicator())
- 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.