bob.ip.binseg.utils.plot

Functions

loss_curve(df)

Creates a loss curve in a Matplotlib figure.

precision_recall_f1iso(data[, confidence])

Creates a precision-recall plot with confidence intervals

bob.ip.binseg.utils.plot.precision_recall_f1iso(data, confidence=True)[source]

Creates a precision-recall plot with confidence intervals

This function creates and returns a Matplotlib figure with a precision-recall plot containing shaded confidence intervals (standard deviation on the precision-recall measurements). The plot will be annotated with F1-score iso-lines (in which the F1-score maintains the same value).

This function specially supports “second-annotator” entries by plotting a line showing the comparison between the default annotator being analyzed and a second “opinion”. Second annotator dataframes contain a single entry (threshold=0.5), given the nature of the binary map comparisons.

Parameters
  • data (dict) –

    A dictionary in which keys are strings defining plot labels and values are dictionaries with two entries:

    • df: pandas.DataFrame

      A dataframe that is produced by our evaluator engine, indexed by integer “thresholds”, containing the following columns: threshold (sorted ascending), precision, recall, pr_upper (upper precision bounds), pr_lower (lower precision bounds), re_upper (upper recall bounds), re_lower (lower recall bounds).

    • threshold: list

      A threshold to graph with a dot for each set. Specific threshold values do not affect “second-annotator” dataframes.

  • confidence (bool, Optional) – If set, draw confidence intervals for each line, using *_upper and *_lower entries.

Returns

figure – A matplotlib figure you can save or display (uses an agg backend)

Return type

matplotlib.figure.Figure

bob.ip.binseg.utils.plot.loss_curve(df)[source]

Creates a loss curve in a Matplotlib figure.

Parameters

df (pandas.DataFrame) – A dataframe containing, at least, “epoch”, “median-loss” and “learning-rate” columns, that will be plotted.

Returns

figure – A figure, that may be saved or displayed

Return type

matplotlib.figure.Figure