Sub topic 12
Conventions for Shared, Reproducible Tracking
Prerequisites and the reproducibility goal
This chapter assumes basic Python, context managers, terminal use, package installation, and experience training and evaluating a scikit-learn model. You should also know the difference between a training set and a test set.
A tracked run is reproducible when another person can understand what happened and repeat it closely enough to verify the result. MLflow records run information, but it cannot infer every detail of your experiment. Your team must agree on conventions for names, tags, inputs, code, and environments.
A useful run should answer these questions:
- Which experiment does this run belong to?
- Which code and data produced it?
- Which choices were fixed before training?
- Which results were measured on which data?
- Where are the model and supporting files?
- Can someone distinguish this run from similar runs?
Use a stable identity for every run
Use one MLflow experiment for one broad problem or product area. Do not create a new experiment for every parameter value. Put the changing choices in parameters and tags instead.
Choose names that remain useful after hundreds of runs. For example, fraud-detection is a better experiment name than test-2. A run name can identify the purpose, such as logreg-baseline or rf-feature-v3.
Tags describe searchable context. Parameters describe values used by the training procedure. Keep these roles consistent.
| Information | Recommended location | Example |
|---|---|---|
| Model hyperparameter | Parameter | `max_depth=8` |
| Dataset identity | Tag or parameter | `dataset_version=2026-04-15` |
| Code revision | Tag | `git_commit=8f31c2a` |
| Lifecycle meaning | Tag | `stage=baseline` |
| Human explanation | Artifact | `notes.md` |
Do not use a tag such as best=true as permanent truth. A later run may become better. Instead, select the current model through a documented comparison or a registry alias.
Record inputs before training
Log the information needed to explain the run at the beginning of the run. This includes the data version, random seed, split method, feature version, library versions, and important preprocessing choices.
A seed alone does not identify the data. Log a dataset version, file checksum, table snapshot, or query revision. If the data changes while keeping the same name, a future run may not reproduce the original result.
A small configuration artifact provides a readable record of related settings:
import json
import mlflow
config = {
"dataset_version": "customers-2026-04-15",
"feature_version": "features-v3",
"random_state": 42,
"test_size": 0.2,
"split_strategy": "random",
}
with mlflow.start_run(run_name="logreg-baseline"):
for key, value in config.items():
mlflow.log_param(key, value)
mlflow.log_dict(config, "config.json")Keep parameters simple and stable. For nested settings, log a JSON or YAML artifact as well as the few values that your team commonly filters on.
Make the environment and code traceable
Record the source revision in a tag or artifact. In a Git repository, the commit identifier is usually the most useful reference. Also save the dependency specification, such as requirements.txt or a lock file. MLflow autologging may capture some library information, but it does not replace an environment definition.
A run should also preserve evaluation details. Log the metric name, data split, threshold, and any post-processing rule. A metric called accuracy is ambiguous if one run uses a validation set and another uses a test set.
The following flow shows the recommended relationship between shared tracking records:
Separate facts from judgments
Use tags for facts such as team, owner, pipeline, and stage. Put interpretations in a notes artifact. For example, stage=baseline is a stable classification, while “chosen because it is easier to explain” is a reason that belongs in notes.
Use a consistent vocabulary. Decide whether your team writes baseline, candidate, and production, or uses another set. Document allowed values and avoid near-duplicates such as prod, production, and live.
Review a run before sharing it
Before treating a run as a candidate for deployment, check that it has:
- A descriptive experiment and run name.
- Dataset and feature versions.
- Code revision and dependency information.
- Explicit random seeds and split details.
- Metrics with clear names and evaluation data.
- The model, signature, and important plots logged as artifacts.
- Tags for owner, team, stage, and purpose.
- Notes explaining unusual decisions or failures.
Teams can enforce these rules in a training wrapper or pipeline. A wrapper can reject a run when required tags are missing. This turns a written convention into a repeatable check.
Exercise
A run has excellent accuracy, but it records only the model's C parameter and the accuracy value. Name three pieces of information you would require before comparing it with another team's run.
Show answer
Require the dataset version, the code and dependency versions, and the evaluation details such as split strategy and test-set identity. A random seed or preprocessing version would also be useful.