Arize Phoenix TS
    Preparing search index...
    • Computes precision, recall, and F-beta score for a batch of expected vs. predicted labels.

      expected/output are the full sequence of labels across an entire dataset, not a single row — this and the evaluators built on it are dataset-level, unlike the package's per-row LLM evaluators. Call it once over every row's collected labels rather than wiring it into a per-row pipeline (e.g. runExperiment's per-row evaluators).

      Supports both binary classification (via positiveLabel, or auto-detected when average is at its default "macro" and the labels are the numeric set {0, 1}) and multi-class classification (via the average strategy).

      Parameters

      Returns PrecisionRecallFScoreResult

      computePrecisionRecallFScore({
      expected: ["cat", "dog", "cat", "bird"],
      output: ["cat", "cat", "cat", "bird"],
      });
      // { precision: 5/9, recall: 2/3, fScore: 0.6, beta: 1, average: "macro", ... }
      computePrecisionRecallFScore(
      { expected: ["spam", "ham", "spam"], output: ["spam", "spam", "ham"] },
      { beta: 0.5, positiveLabel: "spam" }
      );