TL;DR

Queue many Dvc experiments from a script, run them in one go and compare results with dvc exp show to make grid or random search reproducible.

Summary

Hyperparameters live in params.yaml, so DVC tracks each change together with code and data. The tutorial adds Python scripts that call dvc exp run --queue --set-param ... for each configuration: a grid search over 6 values of n_est and 6 of min_split (36 runs) and a random search of 10 runs with a fixed seed. After dvc exp run --run-all, the experiments are compared by ROC-AUC and average precision.

Key takeaways

  1. Keep parameters in params.yaml so DVC notices changes.
  2. Queue instead of editing files: dvc exp run --queue --set-param train.min_split=8.
  3. Run the queue: dvc exp run --run-all.
  4. Compare: dvc exp show --no-timestamp --include-params train.n_est,train.min_split.
  5. Random search can match grid search with a similar budget because it covers the range more widely.
  6. Newer DVC (2.25+) can run grid searches directly via exp run --set-param.

Tools and concepts

ItemRole in the page
DvcExperiment queue, params and comparison
Machine LearningModel tuning workflow
A Practical Introduction to Grid Search, Random Search, and Bayes SearchConceptual background on the search methods
Algorithms for Hyper-Parameter OptimizationPaper on more advanced optimisation

When to use

  1. When running hyperparameter searches reproducibly with DVC.
  2. When you need the queue and compare commands.
  3. When choosing between grid and random search for a given budget.

Caveats

  • Bayesian optimisation is mentioned but not covered; CLI details have evolved since 2021.

Dvc MLOps Machine Learning Git Custom References for ML Experiments A Practical Introduction to Grid Search, Random Search, and Bayes Search Using DVC to create an efficient version control system for data projects