/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * #244 M2 Phase 1 — POST-HOC open-set scoring on the EXISTING (shipped) coarse-placer, NO retrain. * The OA-breadth verdict found the 12-way softmax's own max-prob detector tops out at ~88/88 on * the leave-one-family-out probe (in-map accuracy vs off-map HELDOUT-family caught). This asks: * does a DIFFERENT open-set score, read off the same frozen weights, clear the 90/90 the softmax * can't? * * The 11-way routing (argmax over the in-map classes) is FIXED — the model is unchanged. The only * thing each score changes is the REJECT decision (keep the in-map route vs. abstain → OTHER). We * sweep each score's threshold and trace its (in-map accuracy, heldout-caught) Pareto. * * Scores compared (all functions of the frozen 12 logits / 11 in-map logits `z`): * * - Maxprob : softmax max over the 11 in-map classes (the verdict's baseline detector) * - P_inmap : 1 - P(OTHER) (trust the model's own OTHER head) * - Energy : logsumexp(z) (free-energy; higher = more in-map) * - Maxlogit : max(z) * - Maha : -min_c (z-μ_c)ᵀ Σ⁻¹ (z-μ_c), class-conditional Gaussians (tied Σ) fit on in-map TRAIN * logits (Lee et al. 2018, in the 11-dim in-map-logit space — the linear model's only dense * representation). Higher = closer to the in-map manifold. * * In-map accuracy = of the 11-country test rows, fraction NOT rejected AND argmax-in-map == truth. * heldout caught = of the never-trained off-map families (baltic/oceania/middle-east), fraction * rejected. Both move with the threshold; the Pareto is the whole story. * * Run: `mailwoman placer eval openset [--model ] [--out-md ]` */ type ScoreKey = "maxprob" | "p_inmap" | "energy" | "maxlogit" | "maha"; /** * Options for {@linkcode evalOpenSet}. */ export interface EvalOpenSetOptions { /** * Model artifact dir. Default `$MAILWOMAN_DATA_ROOT/coarse-placer/model`. */ model?: string; /** * Dataset dir. Default `/data/coarse-placer`. */ data?: string; /** * Mahalanobis fit rows per class. Default 2000. */ fitPerClass?: number; /** * Also write the markdown report here. */ outMd?: string; } /** * Result of {@linkcode evalOpenSet}. */ export interface EvalOpenSetResult { /** * Best score by the honest dev→test balanced min. */ winner: ScoreKey; honestMin: number; clears90: boolean; markdown: string; } /** * Coarse-placer post-hoc open-set score comparison — see the module doc. Emits the markdown report to stdout. */ export declare function evalOpenSet(options?: EvalOpenSetOptions, report?: (line: string) => void): Promise; export {}; //# sourceMappingURL=eval-openset.d.ts.map