DVC Experiments are captured automatically by DVC when run. Each experiment creates and tracks a variation of your data science project based on the changes in your workspace.
Experiments preserve a connection to the latest commit in the current branch
HEAD) as their parent or baseline, but do not form part of the regular
Git tree (unless you make them persistent). This prevents bloating your repo
with temporary commits and branches.
dvc exp commands let you automatically track a variation of a project version
(the baseline). You can create independent groups of experiments this way, as
well as review, compare, and restore them later. The basic workflow goes like
dvc exp run(instead of
repro). The results are reflected in your workspace, and tracked automatically.
dvc exp showor
dvc exp diff, using metrics to identify the best one(s). Repeat 🔄
To use DVC Experiments you need a DVC project with a minimal
structure and configuration. To avoid having to bootstrap DVC manually, the
dvc exp init command lets you quickly onboard an existing project to the DVC
It will create a simple
dvc.yaml metafile, which codifies your planned
experiments. This includes the locations for expected dependencies
(data, parameters, source code) and outputs (ML models,
metrics, etc.). These assume sane defaults but can be customized
with the options of
dvc exp init.
💡 We recommend adding the
-i flag to use its
--interactive mode. This will
ask you how to run the experiments, and guide you through customizing the
aforementioned locations (optional).
You can review the resulting changes to your repo (and commit them to Git) to begin using DVC Experiments. Now you can move on to running experiments (next).