orion.evaluation.contextual_recall

orion.evaluation.contextual_recall(expected, observed, data=None, start=None, end=None, weighted=True)[source]

Compute an recall score between the ground truth and the detected anomalies.

Parameters
  • expected (DataFrame or list of tuples) – Ground truth passed as a pandas.DataFrame or list containing two columns: start and stop.

  • observed (DataFrame or list of tuples) – Detected anomalies passed as a pandas.DataFrame or list containing two columns: start and stop.

  • data (DataFrame) – Original data, passed as a pandas.DataFrame containing timestamp. Used to extract start and end.

  • start (int) – Minimum timestamp of the original data.

  • end (int) – Maximum timestamp of the original data.

  • weighted (boolean) – Flag to represent which algorithm to use. If true use weighted segment algorithm, else use overlap segment.

Returns

Recall score between the ground truth and detected anomalies.

Return type

float