probly.visualization.clustermargin.clustervisualizer

Visualizing the uncertainty between two 2D clusters. Derived from margin-based confidence.

Functions

plot_uncertainty(input_1, input_2[, ax, ...])

Method to plot uncertainty between two 2D clusters.

probly.visualization.clustermargin.clustervisualizer.plot_uncertainty(input_1, input_2, ax=None, title='Uncertainty', x_label='Feature 1', y_label='Feature 2', class_labels=None, kernel='rbf', C=0.5, gamma='scale', show=True)[source]

Method to plot uncertainty between two 2D clusters.

Parameters:
  • input_1 (np.ndarray) – First 2D NumPy array with shape (n_samples, 2).

  • input_2 (np.ndarray) – Second 2D NumPy array with shape (n_samples, 2).

  • ax (Axes | None) – Matplotlib Axes to draw the plot on. If None, a new figure and axes are created.

  • title (str) – Title of plot, defaults to “Uncertainty”.

  • x_label (str) – Name of x-axis, defaults to “Feature 1”.

  • y_label (str) – Name of y-axis, defaults to “Feature 2”.

  • class_labels (tuple[str, str] | None) – Optional names for the two classes. Defaults to (“Class 1”, “Class 2”).

  • kernel (Literal['linear', 'rbf', 'sigmoid']) – SVM kernel type, one of {“linear”, “rbf”, “sigmoid”}. Default is “rbf”.

  • C (float) – SVM regularization parameter. Must be > 0.0. Lower values tolerate more outliers.

  • gamma (float | Literal['auto', 'scale']) – Kernel coefficient controlling the influence radius of samples. Must be >= 0.0, or one of {“auto”, “scale”}. Higher values create more local decision boundaries.

  • show (bool) – Whether to display the plot immediately.

Returns:

The Matplotlib Axes containing the uncertainty plot.

Return type:

Axes