Skip to main content
LearnMLAcademy
Advanced10 min read

Experiment Tracking, Reproducibility, Lineage & Model Registry

Track machine learning experiments and manage model versions using MLflow, with pipeline maps, deployment choices, and production reliability checks.

What you will master in this lesson
Intuitive core mechanisms & practical real-world intuition
Step-by-step mathematical breakdown & visual diagrams
Runnable Python implementation & practical trade-offs

Know which experiment produced the model you serve

Training a model creates a claim: with these exact inputs and settings, this artifact produced these measured results. Experiment tracking preserves the evidence behind that claim. A model registry then controls how an immutable candidate moves toward—or away from—production.

A filename such as model_final_v2_really_final.pkl cannot answer which data, feature logic, dependency versions, random seed, or evaluation slices produced it. Renaming files is not model management.

What You Will Be Able to Explain

  • Distinguish an experiment, run, artifact, metadata, and lineage
  • Record enough evidence to reproduce a result
  • Compare candidates with eligibility gates
  • Use a registry as lifecycle governance
  • Plan promotion, canary release, and rollback

Runs, artifacts, lineage and registry states

These terms name different responsibilities. Read the meaning before following them through the diagrams and worked example.

Core vocabulary

Core vocabulary
TermMeaning in this lesson
ExperimentA question or objective investigated through one or more runs.
RunOne execution with fixed recorded inputs, parameters, outputs, timing, and status.
ParameterA developer-chosen training setting such as depth, regularization, or seed.
MetricA measured result such as recall, latency, or error rate.
ArtifactA stored output such as model weights, preprocessing pipeline, plots, or report.
MetadataDescriptive facts—owner, time, versions, tags, status—attached to a run or artifact.
RegistryA governed catalog of model versions, evidence, approval state, deployment state, and rollback relationships.

Reproducibility means reconstructing the complete run

A useful run record connects code version, immutable dataset snapshot, feature version, parameters, random seeds, dependency/environment lock, artifact checksum, metrics, and evaluation slices. Recording only parameters and a headline score leaves hidden variables uncontrolled.

A random seed makes supported random operations repeatable, but it is not a magic guarantee. Hardware kernels, concurrency, external data, and library changes can still alter results. Reproducibility is an evidence discipline, not a single function call.

Lineage lets an investigator move backward from a production prediction to model version and training run, then to feature definitions, data snapshot, code, and environment. It also moves forward: a bad source partition can reveal every candidate or prediction it affected.

A reproducible run has an evidence chain

What must be connected to reproduce a result?

Code commit c41
Dataset snapshot d19
Feature set v4
Parametersdepth=6, seed=42
Environment e7Python + dependency lock
Run R-204start/end, owner
↓ all identifiers recorded together
Artifact model-204.binimmutable checksum
Metrics + slicesaccuracy, recall, latency
How to read it: A metric without its code, data, feature, parameter, environment, and artifact versions is an orphaned number. Lineage records the exact inputs and outputs of the run.

Separate artifact storage from permission to serve

A registry is not merely object storage. It names lifecycle states and authorized transitions—registered candidate, evaluated, approved, canary, production, retired—and records who made each decision from which evidence.

Storage and registry answer different questions

Storage and registry answer different questions
CapabilityArtifact storageModel registry
Keep model bytesYesReferences or contains them
Attach run lineageOptional metadataRequired promotion evidence
Lifecycle statesFolder names at bestExplicit governed states
Approval historyNot inherentReviewer, time, evidence, decision
Production identityAmbiguous latest fileNamed immutable version and deployment relationship
RollbackManually locate fileKnown-good predecessor with audit history

Compare three tracked experiment runs

Compare three tracked experiment runs
RunAccuracyRecallLatencyEligibility
A0.910.6835 msFail: recall < 0.75
B0.900.8142 msPass both gates
C0.920.79125 msFail: latency > 60 ms

Worked Example: Select a production-eligible churn candidate

Given: The team requires recall ≥ 0.75 because missed churners are costly, and p95 inference latency ≤ 60 ms because predictions occur inside an interactive workflow. Runs A, B, and C have the table values above.

  1. Run A: recall 0.68 is below 0.75, so it fails even though latency 35 ms passes.
  2. Run B: recall 0.81 is at least 0.75 and latency 42 ms is at most 60 ms, so it is eligible.
  3. Run C: recall 0.79 passes, but latency 125 ms exceeds 60 ms, so it fails.
  4. Only Run B clears both hard constraints. Comparing accuracy among ineligible runs cannot override the requirements.
  5. Register Run B's immutable artifact with its complete lineage and evidence. Approval and a successful canary are still required before production.

Result and interpretation: Run B—not the 0.92-accuracy Run C—is the eligible candidate. Selection translates product requirements into explicit gates before optimizing a preferred metric.

Promotion uses eligibility gates before ranking

Why does the highest accuracy run not automatically win?

Run Aaccuracy .91 · recall .68 ✕ · 35 ms ✓
Run Baccuracy .90 · recall .81 ✓ · 42 ms ✓
Run Caccuracy .92 · recall .79 ✓ · 125 ms ✕
Gate 1recall ≥ .75
Gate 2latency ≤ 60 ms
Eligible candidateRun B
How to read it: Run A fails the recall requirement and Run C fails the latency requirement. Run B is the only production-eligible candidate, although its accuracy is not the highest.

The following figures turn the example into an operational decision. Follow every branch and note which state is recorded before work continues.

A registry governs model versions through states

How does a tested artifact become production—and roll back safely?

Registered candidate
Evidence attached
Approved
Canary release
Production
Failed canary → route traffic back to previous known-good version; retain audit history
How to read it: Registration does not equal approval. Evidence moves a candidate through review and controlled release; the previous known-good version remains available for rollback.

Record a reproducible run and enforce promotion gates

The label above each block states what it is. Runnable Python can be executed as shown with the standard library; pseudocode and configuration communicate architecture and require adaptation to a real platform.

Record one vendor-neutral run manifest

A plain dictionary illustrates the minimum evidence connection. A tracking tool may store it, but the concepts do not depend on a vendor.

Record one vendor-neutral run manifestPythonRUNNABLE PYTHON
run = {
  "run_id": "R-204",
  "code_version": "c41",
  "dataset_version": "d19",
  "feature_version": "v4",
  "parameters": {"max_depth": 6, "seed": 42},
  "environment_lock": "sha256:env-e7",
  "artifact": {"uri": "models/churn/R-204.bin", "sha256": "..."},
  "metrics": {"accuracy": 0.90, "recall": 0.81, "p95_ms": 42}
}
eligible = run["metrics"]["recall"] >= 0.75 and run["metrics"]["p95_ms"] <= 60
print(eligible)  # True

Choose the evidence needed to approve a model version

  • Define experiment intent and acceptance criteria before running a large parameter search.
  • Store immutable references or checksums, not mutable labels such as latest.csv.
  • Apply hard safety, quality, and operational gates before ranking eligible candidates.
  • Keep the production version and prior known-good version explicit so rollback is a tested transition.

Failure Analysis and Recovery

Observed failure → likely cause → controlled response

Observed failure → likely cause → controlled response
Observed failureLikely causeResponse
Metric cannot be reproducedData, feature, code, seed, or environment version missingMake the run manifest complete and immutable
Best aggregate metric harms a segmentNo slice evaluationAttach required cohort metrics to the promotion gate
Registry says approved but evidence changedMutable report or artifactUse checksums and immutable evaluation records
Rollback loads incompatible preprocessingModel stored without its input contractPackage/version preprocessing and schema with the artifact

Connect to Earlier Lessons

  • Hyperparameter tuning

    Connect search trials to reproducible run records.

  • Model evaluation

    Review why recall and error types can outweigh accuracy.

  • LLMOps

    See application-level prompt, retrieval, and model versioning for LLM systems.

Summary / Key Takeaways

  • An experiment contains runs; each run connects fixed inputs and parameters to artifacts and measured outputs.
  • Reproducibility requires code, data, features, parameters, environment, seed, artifact, and metrics—not a descriptive filename.
  • A seed controls supported randomness but cannot compensate for changing data, dependencies, hardware behaviour, or hidden state.
  • Lineage supports backward diagnosis and forward impact analysis across versions.
  • Production eligibility gates encode minimum quality and operational constraints before candidates are ranked.
  • The highest accuracy run may be ineligible when recall, latency, fairness, or reliability requirements fail.
  • A model registry governs evidence, approval, release state, production identity, retirement, and rollback rather than only storing files.

Apply this concept in a real hands-on project

You have studied the idea. Now use it in working Python code, see the calculation and output, and explain what changed. Each project includes step-by-step instructions, full source and tests.

Practice challenge: predict an outcome first, run the code, and explain the difference.

Track Your Progress0% curriculum done

Finished "Experiment Tracking, Reproducibility, Lineage & Model Registry"?

Mark this lesson as completed to update your progress bar and track your milestones across the full curriculum.

Overall Progress0 / 167 lessons

Was this tutorial helpful?

Your feedback helps us continuously refine and improve our open-access tutorials.

Knowledge Check

Progress: 0/5

Test your active recall. Choose one answer for each question, then check it to reveal the step-by-step reasoning.

Question 1 of 5conceptual
Which record is sufficient to reproduce a model result?
Question 2 of 5numerical/formula
Requirements are recall ≥ 0.75 and latency ≤ 60 ms. Which run is eligible?
Question 3 of 5interpretation
Why is model_final_v2_really_final.pkl poor model management?
Question 4 of 5practical selection
A registered candidate has excellent metrics. What should happen next?
Question 5 of 5debugging/diagnostic
A production issue is traced to dataset snapshot d19. Which lineage capability is most useful now?

Knowledge Check Review & Explanations

Review the questions, verified correct answers, and conceptual explanations for this lesson.

1Which record is sufficient to reproduce a model result?▼

Correct Answer: Code, data, features, parameters, environment, artifact, and metrics

Reproduction requires the connected versions and outputs of the whole run. A score, filename, or seed leaves hidden inputs uncontrolled.

2Requirements are recall ≥ 0.75 and latency ≤ 60 ms. Which run is eligible?▼

Correct Answer: B: recall .81, latency 42 ms

Run B is the only run that passes both hard gates. A fails recall and C fails latency, regardless of accuracy.

3Why is model_final_v2_really_final.pkl poor model management?▼

Correct Answer: It cannot encode complete immutable lineage, evidence, approval, and deployment state

A filename is not a governed evidence chain. It cannot reliably represent all run inputs, checksums, reviews, production identity, and rollback relationships.

4A registered candidate has excellent metrics. What should happen next?▼

Correct Answer: Apply required review and controlled release gates

Registration is only a lifecycle state. Approval and canary evidence remain separate before production promotion.

5A production issue is traced to dataset snapshot d19. Which lineage capability is most useful now?▼

Correct Answer: Finding every run and artifact that consumed d19

Forward impact analysis follows a bad input to all affected downstream runs and artifacts so the incident scope can be identified.

Keep moving through the path

Continue Learning

Free Download: ML Interview Cheatsheet

100 essential Machine Learning interview questions and answers covering foundations, algorithms, evaluation, deep learning, Python, system design and interview strategy. Enter your email to download it instantly.

Next