Production ML

Dataset Versioning

Dataset versioning pins the data snapshot, transformation, split, schema, license/use scope, and provenance behind each reported result.

status: reviewimportance: importantdifficulty 3/5math: undergraduateread: 12mprediction probe

Concept Structure

Dataset Versioning

01Intuition

Start with the picture, metaphor, or geometric mechanism.

02Math

Make the objects explicit and connect them with notation.

03Code

Mirror the equations with runnable implementation details.

04Interactive Demo

Commit a prediction against the code witness.

1prerequisites
2next concepts
2related links

Learner Contract

What this page should let you do.

You are here becauseDataset versioning pins the data snapshot, transformation, split, schema, license/use scope, and provenance behind each reported result.

This Production ML concept is the current object: keep the same invariant visible across Intuition, Math, Code, Interactive Demo.

Before thisEvaluation Pipelines

1 prerequisite listed; refresh them before leaning on the math or code.

By the end4/4 sections ready | code witness expected | prediction probe

Explain the mechanism, trace the main notation, and answer the prediction probe against the code witness.

Do this firstIntuition

Read the intuition before the notation; the math should name a mechanism you already felt.

Test the linkUse the prediction probe to commit to the mechanism before moving on.Then continue to Evaluation Harnesses and Benchmark Contamination

Claim/source review status

Claim review needed

Some claims still need exact source-support review.Metadata-derived; review may be AI-assisted. Not a human certification.
Claims0/1 reviewed
Sources3 cited
Codeattached
Demoplanned
Reviewednot recorded
Updatedpage 2026-06-30

Object flow

4/4 sections readyAsk about thisResearch room
ConceptDataset VersioningProduction ML
3 sources attachedLocal snapshot ready
concept:production-ml/dataset-versioning
01

01

Intuition

Build the mental picture first so the rest of the page has something to attach to.

Section prompt

An evaluation score is only meaningful if we can say what evidence produced it. If yesterday's model scored 82 percent and today's model scored 84 percent, the obvious story is that the model improved. But that story collapses if the test set changed, the preprocessing code silently filtered out hard examples, or a benchmark near-duplicate entered training.

Dataset versioning is the habit of naming the evidence bundle, not merely naming a folder. The bundle includes the raw snapshot, the transformation code, the split manifest, the schema, the license or use scope, and a provenance note. A score without that bundle is a loose number. A score with that bundle is a claim someone else can inspect.

Think of a dataset version like the sealed envelope behind an experiment. It does not guarantee that the experiment is good. It makes the experiment auditable enough that we can ask sharper questions: Did the data change? Did the split change? Did train and test leak into each other? Did the allowed use change? Are two reported scores even answering the same question?

This page is deliberately tool-agnostic. DVC is a useful source for the artifact-versioning pattern, and datasheets are useful for provenance and lifecycle documentation. The teaching contract here is smaller than a full production data governance system: before comparing scores, record the exact data evidence bundle and reject comparisons whose bundle changed or became invalid.

02

02

Math

Translate the story into symbols, assumptions, and a derivation you can inspect.

Section prompt

Let DrawD_{\mathrm{raw}} be a raw data snapshot, TT be the transformation code and parameters, SS be the split manifest, AA be the schema and annotation assumptions, UU be the license or use scope, and PP be the provenance note. A dataset version is the tuple

VD=(Draw,T,S,A,U,P),hD=H(canon(VD)).V_D = (D_{\mathrm{raw}}, T, S, A, U, P), \qquad h_D = H(\operatorname{canon}(V_D)).

Here HH is a collision-resistant hash used as a fingerprint, and canon\operatorname{canon} means a deterministic serialization. The hash is not the whole governance story. It is the short handle that points back to the inspectable bundle.

Let MM be a metric contract, ff be a model, and StestS_{\mathrm{test}} be the test split named by SS. For examples (xi,yi)(x_i,y_i) in that test split, a simple average score can be written as

Q(f;VD,M)=1Stest(xi,yi)Stestm(f(xi),yi;M).Q(f; V_D, M) = \frac{1}{|S_{\mathrm{test}}|} \sum_{(x_i,y_i)\in S_{\mathrm{test}}} m(f(x_i), y_i; M).

Two scores Q(fa;Va,Ma)Q(f_a;V_a,M_a) and Q(fb;Vb,Mb)Q(f_b;V_b,M_b) are cleanly comparable only when the relevant evidence contract is the same: the dataset fingerprint matches, the metric contract matches, and the validity checks pass. If the raw snapshot or split changes, the score may still be useful, but it answers a different question. If the split leaks, provenance is missing, or the use scope is absent, the score should be treated as invalid evidence until the bundle is repaired.

The key mental move is to separate three cases:

  • Same version: the bundle fingerprint and validity checks match.
  • New version: the bundle changed in an allowed and recorded way.
  • Invalid evidence: a required part of the bundle is missing or violates the evaluation contract.
03

03

Code

Keep the implementation aligned with the notation so the algorithm is legible.

Section prompt

This witness is intentionally small. It fingerprints a dataset bundle, then classifies candidate changes as same version, new version, or invalid evidence.

import copy, hashlib, json

BASE = {
    "raw": "s3://cf-demo/reviews/raw-2026-06-01.csv",
    "transform": "clean_v3.py:strip_html+dedupe",
    "split": {"train": ["a1", "a2"], "test": ["b1", "b2"]},
    "schema": "text,label@v2",
    "use_scope": "research-demo-ok",
    "provenance": "exported from consented review corpus",
}

def fingerprint(bundle):
    payload = json.dumps(bundle, sort_keys=True, separators=(",", ":"))
    return hashlib.sha256(payload.encode()).hexdigest()

def valid(bundle):
    if not bundle.get("use_scope") or not bundle.get("provenance"):
        return False, "missing use scope or provenance"
    train = set(bundle["split"].get("train", []))
    test = set(bundle["split"].get("test", []))
    if train & test:
        return False, "train/test split overlap"
    return True, "valid"

def classify(old, new):
    ok, reason = valid(new)
    if not ok:
        return "invalid evidence", reason
    if fingerprint(old) == fingerprint(new):
        return "same version", fingerprint(new)[:12]
    return "new version", fingerprint(new)[:12]

cases = {
    "rerun": {},
    "new raw export": {"raw": "s3://cf-demo/reviews/raw-2026-06-15.csv"},
    "license missing": {"use_scope": ""},
    "split leak": {"split": {"train": ["a1", "b1"], "test": ["b1", "b2"]}},
}

for name, patch in cases.items():
    candidate = copy.deepcopy(BASE)
    candidate.update(patch)
    print(name, "=>", classify(BASE, candidate))

The witness is not a replacement for a data catalog, a legal review, or a privacy review. It is a compact reproduction habit: the score comparison begins by checking whether the evidence bundle is identical, newly versioned, or invalid.

04

04

Interactive Demo

Use the authored prediction probe to test the mechanism without a live widget.

Section prompt

Prediction drill: before revealing the answer, label each candidate change as same version, new version, or invalid evidence.

Baseline evidence bundle: raw snapshot raw-2026-06-01.csv; transform clean_v3.py; split manifest with disjoint train and test IDs; schema text,label@v2; use scope research-demo-ok; provenance note consented review corpus.

Candidate A: the model is rerun, but every dataset field is identical.

Candidate B: the raw snapshot changes to raw-2026-06-15.csv, and the change is recorded.

Candidate C: the split manifest puts example b1 in both train and test.

Candidate D: the license or use-scope field is empty.

Reveal:

  • Candidate A is same version. A rerun can still differ because of model randomness or infrastructure, but the dataset evidence bundle did not change.
  • Candidate B is new version. The comparison may be useful, but it is not the same dataset question.
  • Candidate C is invalid evidence. Split overlap means the evaluation contract is broken.
  • Candidate D is invalid evidence. A missing use scope makes the result unsuitable as a trustworthy public reproduction artifact.

The sharp habit is to ask this before celebrating a better score: did the model improve, or did the evidence bundle move?

After The First Pass

Turn the concept into an inspected object.

Once the invariant is visible in the intuition, math, code, and demo, use these panels to inspect the mechanism visually, check source support, practice the idea, and attach a grounded research question.

Mechanism Storyboard

See the idea move before the page explains it

Dataset versioning pins the data snapshot, transformation, split, schema, license/use scope, and provenance behind each reported result.

Demo notes open01 / Intuition
Prediction lens

Start with the picture, metaphor, or geometric mechanism.

Commit first

Before reading further, choose the kind of change Dataset Versioning should make visible.

Visual Inquiry

Make the image answer a mathematical question

Dataset versioning pins the data snapshot, transformation, split, schema, license/use scope, and provenance behind each reported result.

4/4 stages readyDemo notes connected
Prediction

Which visible object should carry the first intuition?

Commit first

Pick the cue that should make Dataset Versioning easier to reason about before the page gives the answer.

Source Grounding

Canonical references for the mechanism on this page.

documentation · 2026DVC Documentation: Data VersioningDVC

Tool-specific source for versioning data, models, and intermediate artifacts alongside code.

Open source
paper · 2021Datasheets for DatasetsGebru, Morgenstern, Vecchione, Vaughan, Wallach, Daume III, and Crawford

Source for documenting dataset motivation, composition, collection, preprocessing, distribution, use, and maintenance.

Open source
documentation · 2026scikit-learn User Guide: Common pitfalls and recommended practicesscikit-learn developers

Source for the data-leakage warning that train and test information must not contaminate each other.

Open source

Claim Review

Dataset versioning pins the data snapshot, transformation, split, schema, license/use scope, and provenance behind each reported result.

StatusSubstantive claim review pending

Source IDs and witness objects are attached for review; they are not proof by themselves.

Sources3 references

dvc-data-versioning, gebru-datasheets, sklearn-data-leakage

Witnesses3 local objects

Use equation, code, and demo objects to check whether the source support is operational.

Source-note reviewed; substantive support review pendingDataset versioning treats raw snapshot, transform code, split manifest, schema, use scope, and provenance as the frozen evidence bundle; changing or invalidating one means scores answer a different or untrustworthy question.Claim metadata: needs review

The sources jointly motivate versioned artifacts, documented dataset provenance and lifecycle fields, and split/leakage discipline for evaluation.

Sources: DVC Documentation: Data Versioning, Datasheets for Datasets, scikit-learn User Guide: Common pitfalls and recommended practicesThis is a tool-agnostic teaching contract, not a claim that one hash, DVC, or a datasheet alone solves legal, privacy, governance, or production reproducibility needs.The source note has been inspected, but exact source support still needs substantive review.

Practice Loop

Try the idea before it explains itself

Dataset versioning pins the data snapshot, transformation, split, schema, license/use scope, and provenance behind each reported result.

Readiness0/3 checks ready
Predict

Before touching the demo, predict one visible change that should happen in Dataset Versioning.

Hint 1

Reveal when your model needs a nudge.

Hint 2

Reveal when your model needs a nudge.

Hint 3

Reveal when your model needs a nudge.

Object research drawerClose
ConceptDataset VersioningProduction ML
Code witness comparisonDataset Versioning code witness 1BASE = {Prediction before revealDataset Versioning predictionUse the prediction probe to commit to the mechanism before moving on.
Grounded room questionWhat is the smallest example that makes Dataset Versioning click without losing the math?Local snapshot ready

Research Room

Attach the question to an exact object

Pick the concept, equation, source, code witness, claim, misconception, or demo state before asking for help. The handoff stays grounded to that object.
Next local actionNo local draft saved yet

Open the draft below to save one note and next action in this browser.

conceptProduction ML

Dataset Versioning

Anchored question

What is the smallest example that makes Dataset Versioning click without losing the math?

Local action draftNo local draft saved yetExpand only when ready to capture one local next action
Local action draft

This draft stays locally in this browser for concept:production-ml/dataset-versioning.

No local draft saved.
Evidence to inspect
  • Source ids to inspect: dvc-data-versioning, gebru-datasheets, sklearn-data-leakage
  • Definition, prerequisite, and contrast concept links
  • The equation or code witness that makes the concept operational
  • One demo state that shows the invariant instead of a slogan
What would resolve this
  • The learner can state the mechanism in their own words
  • The learner can name the prerequisite that would repair confusion
  • The learner can predict how the mechanism changes under one perturbation
Grounded AI handoff

I am working in Continuous Function's research reading room. Object: concept - Dataset Versioning Object key: concept:production-ml/dataset-versioning Context: Production ML Anchor id: concept/concept-notebook/production-ml/dataset-versioning Open question: What is the smallest example that makes Dataset Versioning click without losing the math? Evidence to inspect: - Source ids to inspect: dvc-data-versioning, gebru-datasheets, sklearn-data-leakage - Definition, prerequisite, and contrast concept links - The equation or code witness that makes the concept operational - One demo state that shows the invariant instead of a slogan What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action.

Open source object
concept/concept-notebook/production-ml/dataset-versioning concept:production-ml/dataset-versioning