UNPKG

@arizeai/phoenix-evals

Version:
16 lines 1.24 kB
import type { EvaluatorBase } from "../core/EvaluatorBase.js"; import { type ClassificationExample, type PrecisionRecallFScoreOptions, type PrecisionRecallFScoreResult } from "./classificationMetrics.js"; /** * Computes a {@link PrecisionRecallFScoreResult} for a batch of labels. * Injectable so callers (e.g. {@link createPrecisionRecallFScoreEvaluators}) * can share one computed result across multiple metric evaluators instead of * recomputing it per evaluator. */ export type ClassificationMetricComputer = (example: Pick<ClassificationExample, "expected" | "output">, options: PrecisionRecallFScoreOptions) => PrecisionRecallFScoreResult; /** * Internal factory shared by `createPrecisionEvaluator`, `createRecallEvaluator`, * and `createFBetaEvaluator` — each is a thin wrapper that only differs in * which result field it reads and how its metric name is built. */ export declare function createClassificationMetricEvaluator<RecordType extends ClassificationExample = ClassificationExample>(name: string, field: "precision" | "recall" | "fScore", options: PrecisionRecallFScoreOptions, compute?: ClassificationMetricComputer): EvaluatorBase<RecordType>; //# sourceMappingURL=createClassificationMetricEvaluator.d.ts.map