liveBook · Manning

Recall

As explained in Time Series Forecasting Using Foundation Models

Recall is the proportion of actual positive observations that a detection system correctly identifies.

Recall is the proportion of actual positive observations that a detection system correctly identifies: true positives divided by true positives plus false negatives. section 3.8.2

Use recall to interpret anomaly-detection coverage:

  • High recall means the system misses few actual anomalies, but it may label many normal points incorrectly. section 5.8 section 8.8.3
  • Reducing a prediction interval generally increases recall while decreasing precision; prioritize recall when missing anomalies is more costly. section 3.8.2
  • Compare recall with precision and F1 score rather than treating it as a complete performance assessment. section 3.8.2

Anomaly-detection evaluation

A detector that identifies three of four true anomalies achieves 0.75 recall, even though only 38% of its flagged points are correct. section 3.8.2

Listing 3.26 Function to evaluate anomaly detection
def evaluate_anomaly_detection(df, preds_col, actual_col):
    tp = ((df[preds_col] == 1) & (df[actual_col] == 1)).sum()

    tn = ((df[preds_col] == 0) & (df[actual_col] == 0)).sum()

    fp = ((df[preds_col] == 1) & (df[actual_col] == 0)).sum()

    fn = ((df[preds_col] == 0) & (df[actual_col] == 1)).sum()

    precision = tp / (tp + fp) if (tp + fp) != 0 else 0

    recall = tp / (tp + fn) if (tp + fn) != 0 else 0

    f1_score = 2 * (precision * recall) / (precision + recall) if
    ➥(precision + recall) != 0 else 0

    return precision, recall, f1_score

Inspect the Python implementation that counts true positives and false negatives before calculating recall. section 3.8.2

How Time Series Forecasting Using Foundation Models covers it

How deep it goes
Defines recall, implements its confusion-matrix calculation, and demonstrates its trade-off with precision and F1 score.
Examples
Uses TimeGPT, Chronos, Llama-3.2, and daily New York City taxi anomaly detection examples.
What it assumes
Assumes actual and predicted anomaly labels; teaches the true-positive and false-negative calculation through Python.
What you can do after
Evaluate anomaly detectors by measuring missed anomalies and balancing recall against false-positive costs.
How it connects
Connects recall to anomaly detection, precision, F1 score, prediction intervals, and false positives.

Also explained in

Compare how 24 books explain recall →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Time Series Forecasting Using Foundation Models. The section links point to the parts of the book it draws on.