Orion
orion.evaluation.
contextual_f1_score
Compute an f1 score between the ground truth and the detected anomalies.
expected (DataFrame or list of tuples) – Ground truth passed as a pandas.DataFrame or list containing two columns: start and stop.
pandas.DataFrame
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.
F1 score between the ground truth and detected anomalies.
float