Skip to content

Reproducible train/eval split helper for post-training exports #103

Description

@dcfocus

Summary

Add a reproducible train/eval split helper for post-training exports: deterministically partition records into train and held-out eval sets so that no conversation/session leaks across the boundary, and the same split reproduces on re-run.

Follow-up to #96 (curate + export); related to the eval-set construction in #98.

Motivation

#96 covers reproducible export cuts (version pinning + manifest) but not splitting a cut into train vs. eval. Naive row-level random splits leak: turns from the same session land on both sides, inflating eval scores. Splitting must be at a grouping boundary (session/run/user) and deterministic for reproducibility.

Proposed work

  • A split helper on the export path (e.g. export_training(..., split={"eval_fraction": 0.1, "by": "session_id", "seed": 42})) that:
    • assigns each group (default session_id, configurable to run_id / tenant / external-id prefix) to train or eval by a stable hash of the group key + seed — so no group spans both sides and the split is reproducible;
    • writes train and eval as separate outputs, each with its own manifest noting the split params (fraction, group key, seed) and the complementary set's id.
  • Optional: emit the eval set in the labeled query-set format consumed by Retrieval-quality + version A/B evaluation harness (recall@k / MRR / nDCG) #98 so retrieval/eval reuse the same artifact.

Non-goals

Acceptance criteria

  • A user can split an export into train/eval by a grouping key with a fixed seed, and re-running yields the identical partition.
  • No group (e.g. session_id) appears in both train and eval.
  • Each output carries a manifest recording split params for reproducibility.
  • Tests cover determinism (same seed → same split), group-disjointness, and fraction accuracy within tolerance.

Notes

Hold until #96 has an implementation to build on. Shares the eval-set format with #98 and composes with #96 decontamination.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions