import { type EvaluationGroups, type EvaluationGroupsIdentity, type RequiredGroupSkip } from "#utils/evaluation-groups"; /** * The attribute name a validation-group file declares. */ export declare const VALIDATION_GROUPS_ATTRIBUTE = "validation-groups"; /** * The quota's parameters. */ export interface ValidationQuota { /** * The multiple of a country's validation floor its target asks for. */ margin: number; /** * The rows every country with a held-out pool aims at, floor or none. */ minimumRows: number; /** * The most rows one country's validation groups may hold. */ capRows: number; } /** * The quota the v0.8.19 corpus is split under. */ export declare const DEFAULT_VALIDATION_QUOTA: ValidationQuota; /** * A country's validation floor, as the training config states it. */ export interface ValidationFloor { minRows: number; minStreetRows: number; } /** * A country's quota target. */ export interface ValidationTarget { rows: number; streetRows: number; } /** * The target of one country under a quota: `min(cap, max(margin × floor, minimum))` rows * and `min(cap, margin × street floor)` street rows. * A country without a floor aims at the minimum. */ export declare function validationTarget(floor: ValidationFloor | undefined, quota: ValidationQuota): ValidationTarget; /** * One group of a country's held-out pool. */ export interface ValidationCandidate { country: string; group: string; rows: number; streetRows: number; } /** * What the quota took from one country. */ export interface ValidationCountrySelection { target: ValidationTarget; /** * The country's held-out pool, as far as the caller read it. */ poolRows: number; poolGroups: number; rows: number; streetRows: number; groups: number; /** * The pool ran out before the target was met, so the country keeps all of it. */ exhausted: boolean; } /** * Takes each country's groups lowest `hashUint32` first, ties broken by the group string, * until the country holds its target rows and street rows or reaches the cap. * * A caller may pass only the head of a country's pool in hash order, as long as the head reaches the cap. * `poolRows` and `poolGroups` then describe that head, and the caller records the whole pool's figures. */ export declare function selectValidationGroups(candidates: Iterable, targetOf: (country: string) => ValidationTarget, quota: ValidationQuota): { groups: string[]; countries: Record; }; /** * The file a quota pass writes beside the corpus it measured. */ export interface ValidationGroupsFile { attribute: typeof VALIDATION_GROUPS_ATTRIBUTE; /** * The corpus manifest whose held-out pool was read. */ drawnFrom: { manifest: string; sha256: string; corpusVersion: string | null; }; /** * The training config whose validation floors set the targets. */ config: { path: string; sha256: string; }; /** * The frozen group list the pool excluded. */ evaluationGroups: EvaluationGroupsIdentity; /** * The groups the config's training receipts require and the pool left out, by country. * A file written before the skip records none. */ requiredTrainingGroups?: RequiredGroupSkip; quota: ValidationQuota; countries: Record; groups: string[]; } /** * The validation lookup a split applies. */ export interface ValidationGroups { path: string; sha256: string; quota: ValidationQuota; /** * The frozen list's sha256 the pool excluded. */ evaluationGroupsSHA256: string; groups: ReadonlySet; } /** * Reads a validation-group file. * * @throws When the file declares another attribute or records no quota. */ export declare function readValidationGroups(path: string): Promise; /** * The two lists the evaluation-group policy applies. * * Frozen groups go to `test` and validation groups go to `val`. */ export interface EvaluationGroupPolicy { frozen: EvaluationGroups; validation: ValidationGroups; } /** * Pairs the two lists, refusing a validation list drawn against another frozen list * or one that holds a frozen group, since such a group's rows could take only one split. */ export declare function evaluationGroupPolicy(frozen: EvaluationGroups, validation: ValidationGroups): EvaluationGroupPolicy; /** * Reads both lists and pairs them with {@linkcode evaluationGroupPolicy}. */ export declare function readEvaluationGroupPolicy(paths: { evaluationGroups: string; validationGroups: string; }): Promise; /** * What a split policy hash and a corpus manifest record about the policy applied. */ export interface EvaluationGroupPolicyIdentity { evaluationGroups: EvaluationGroupsIdentity; validationGroups: { sha256: string; quota: ValidationQuota; groups: number; }; } /** * The identity of a policy: both lists' sha256, the frozen sets, the quota and the group counts. */ export declare function evaluationGroupPolicyIdentity(policy: EvaluationGroupPolicy): EvaluationGroupPolicyIdentity; //# sourceMappingURL=validation-groups.d.ts.map