probly.visualization.credal.plot_2d

Plotting for 2 class probabilities.

Classes

IntervalVisualizer()

Class to create 2d plots.

class probly.visualization.credal.plot_2d.IntervalVisualizer[source]

Bases: object

Class to create 2d plots.

interval_plot(probs, labels, title, mle_flag, credal_flag, ax=None)[source]

Plot the interval plot.

Parameters:
  • probs (np.ndarray) – Probability vector for 2 classes.

  • labels (list[str]) – Labels for the interval plot.

  • title (str) – Title of the plot.

  • mle_flag (bool) – Flag to indicate whether median of probabilities is shown.

  • credal_flag (bool) – Flag to indicate whether min/max interval is shown.

  • ax (Axes | None) – Axes to draw the plot on. If None, a new Axes is created.

Returns:

Interval plot.

Return type:

Axes

probs_to_coords_2d(probs)[source]

Convert 2D probabilities to 2D coordinates.

Parameters:

probs (ndarray) – Probability vector for 2 classes.

Returns:

Cartesian coordinates as tuple.

Return type:

tuple