@arizeai/phoenix-evals
Version:
A library for running evaluations for AI use cases
16 lines • 1.23 kB
TypeScript
import type { EvaluatorBase } from "../core/EvaluatorBase";
import { type ClassificationExample, type PrecisionRecallFScoreOptions, type PrecisionRecallFScoreResult } from "./classificationMetrics";
/**
* 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