UNPKG

@arizeai/phoenix-evals

Version:
23 lines 981 B
import type { EvaluatorBase } from "../core/EvaluatorBase.js"; import type { ClassificationExample, PrecisionRecallFScoreOptions } from "./classificationMetrics.js"; export type F1EvaluatorOptions = Omit<PrecisionRecallFScoreOptions, "beta">; /** * 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 declare function createF1Evaluator<RecordType extends ClassificationExample = ClassificationExample>(options?: F1EvaluatorOptions): EvaluatorBase<RecordType>; //# sourceMappingURL=createF1Evaluator.d.ts.map