bob.ip.binseg.utils.plot¶
Functions
|
Creates a loss curve in a Matplotlib figure. |
|
Creates a precision-recall plot with credible intervals |
- bob.ip.binseg.utils.plot.precision_recall_f1iso(data, credible=True)[source]¶
Creates a precision-recall plot with credible intervals
This function creates and returns a Matplotlib figure with a precision-recall plot containing shaded credible intervals (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.DataFrameA dataframe that is produced by our evaluator engine, indexed by integer “thresholds”, containing the following columns:
threshold,tp,fp,tn,fn,mean_precision,mode_precision,lower_precision,upper_precision,mean_recall,mode_recall,lower_recall,upper_recall,mean_specificity,mode_specificity,lower_specificity,upper_specificity,mean_accuracy,mode_accuracy,lower_accuracy,upper_accuracy,mean_jaccard,mode_jaccard,lower_jaccard,upper_jaccard,mean_f1_score,mode_f1_score,lower_f1_score,upper_f1_score,frequentist_precision,frequentist_recall,frequentist_specificity,frequentist_accuracy,frequentist_jaccard,frequentist_f1_score.threshold:listA threshold to graph with a dot for each set. Specific threshold values do not affect “second-annotator” dataframes.
credible (
bool, Optional) – If set, draw credible intervals for each line, usingupper_*andlower_*entries.
- Returns
figure – A matplotlib figure you can save or display (uses an
aggbackend)- Return type
- 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