# Experiment Tracking with MLflow and Weights and Biases

> Log parameters, metrics, artifacts and code versions for every run so you can compare, reproduce and promote models with confidence. Free notes, key concepts,...

Canonical: https://www.internhack.in/roadmaps/tracks/machine-learning/experiment-tracking
Last updated: 2026-11-28

Log parameters, metrics, artifacts and code versions for every run so you can compare, reproduce and promote models with confidence.

Intermediate · about 5 hours · difficulty 2/5

Learn first: [From Notebook to Production Code](https://www.internhack.in/roadmaps/tracks/machine-learning/notebook-to-production-code)

After a few dozen training runs, nobody remembers which learning rate produced the good model or which data version it used. **Experiment tracking** records that automatically.

### What to log for every run

- **Parameters**: hyperparameters and config values.
- **Metrics**: training and validation curves, final test scores.
- **Artifacts**: model files, plots, confusion matrices, sample predictions.
- **Context**: git commit, data version, environment, hardware.

### Tools

- **MLflow** (open source, self-hostable): tracking server, UI, `mlflow.autolog()` for popular libraries, and a **model registry** with versions and aliases such as `champion`.
- **Weights and Biases** (hosted, free for personal use): rich dashboards, sweeps for hyperparameter search, reports to share findings.
- Alternatives include TensorBoard for curves and Neptune or Comet.

### Working habits

- Name experiments by question ("does augmentation X help?") rather than by date.
- Compare runs with parallel coordinates and overlaid curves before deciding.
- Tag the run that becomes production and register it, so serving code loads a model by name and version instead of a file path.
- Log enough to rerun: a run you cannot reproduce is only an anecdote.

**Good enough to move on** when every training run you do is tracked, you can reproduce a registered model from its logged metadata, and you can load a model from the registry in a separate script.

## Key concepts

- **Logging params, metrics and artifacts**
- **MLflow tracking and autolog**
- **Model registry and aliases**
- **Weights and Biases dashboards**
- **Sweeps for hyperparameter search**
- **TensorBoard**

## Mini project

Add MLflow tracking to your refactored project, run a 20-trial hyperparameter search, register the best model, and write a script that loads the champion model by alias and scores new data.

## Check yourself

What information would you need to exactly reproduce a model from three months ago, and where would each piece be stored?

## Free resources

- [MLflow documentation](https://mlflow.org/docs/latest/index.html) (MLflow)
- [Weights and Biases documentation](https://docs.wandb.ai/) (Weights and Biases)

Previous: [From Notebook to Production Code](https://www.internhack.in/roadmaps/tracks/machine-learning/notebook-to-production-code) · Next: [Data and Model Versioning with DVC](https://www.internhack.in/roadmaps/tracks/machine-learning/data-versioning)

## More in MLOps: Shipping and Operating Models

- [From Notebook to Production Code](https://www.internhack.in/roadmaps/tracks/machine-learning/notebook-to-production-code)
- [Experiment Tracking with MLflow and Weights and Biases](https://www.internhack.in/roadmaps/tracks/machine-learning/experiment-tracking)
- [Data and Model Versioning with DVC](https://www.internhack.in/roadmaps/tracks/machine-learning/data-versioning)
- [Docker for ML](https://www.internhack.in/roadmaps/tracks/machine-learning/docker-for-ml)
- [Serving Models with FastAPI and BentoML](https://www.internhack.in/roadmaps/tracks/machine-learning/model-serving)
- [ML Pipelines, Orchestration and CI/CD](https://www.internhack.in/roadmaps/tracks/machine-learning/ml-pipelines-cicd)
- [Monitoring, Drift and Model Maintenance](https://www.internhack.in/roadmaps/tracks/machine-learning/model-monitoring)
- [Feature Stores](https://www.internhack.in/roadmaps/tracks/machine-learning/feature-stores)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Machine Learning Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/machine-learning)
