@arizeai/phoenix-evals
Version:
A library for running evaluations for AI use cases
23 lines • 746 B
JavaScript
import { createFBetaEvaluator } from "./createFBetaEvaluator.js";
/**
* Creates a code evaluator that computes the F1 score: the harmonic mean of
* precision and recall.
*
* Supports binary classification (via `positiveLabel`, or auto-detected when
* labels are the numeric set `{0, 1}`) and multi-class classification (via
* the `average` strategy).
*
* @example
* ```typescript
* const f1 = createF1Evaluator();
* const result = await f1.evaluate({
* expected: ["cat", "dog", "cat", "bird"],
* output: ["cat", "cat", "cat", "bird"],
* });
* // { score: 0.6 }
* ```
*/
export function createF1Evaluator(options = {}) {
return createFBetaEvaluator({ ...options, beta: 1 });
}
//# sourceMappingURL=createF1Evaluator.js.map