UNPKG

mongodb-rag-core

Version:

Common elements used by MongoDB Chatbot Framework components.

13 lines 692 B
import { MatchFunc } from "./MatchFunc"; import { Primitive } from "./Primitive"; /** Calculate Average Precision (AP) for a single query. Average Precision is the average of the precision scores at each rank where a relevant item appears. @param relevantItems - List of relevant items @param retrievedItems - List of retrieved items @param matchFunc - Function to compare items for equality @param k - Value of k (top-k results to consider) @returns Average Precision (AP) */ export declare function averagePrecisionAtK<T extends Primitive>(relevantItems: T[], retrievedItems: T[], matchFunc: MatchFunc<T>, k: number): number; //# sourceMappingURL=averagePrecisionAtK.d.ts.map