dvc.org
dvc.org copied to clipboard
ref: `exp run --set-param` with templating
It'd be great to have an example of experiments coupled with the parametrization (or at least a mention that it's possible?).
# dvc.yaml
stages:
build:
cmd: python src/main.py ${test_size}
deps:
- src/main.py
outs:
- model.pickle
metrics:
- metrics.json:
cache: false
$ dvc exp run --set-param "test_size=0.5"
So in this case, with exp run -S test_size=30, the cmd in dvc.yaml would be python src/main.py 30? @skshetry
That would def. be pretty important to mention both in https://dvc.org/doc/user-guide/project-structure/pipelines-files#templating, as well as in Exps docs (for starters in the exp run -S ref.).
But what if test_size is not in a params file, just a vars entry?
Sorry for the late response, @jorgeorpinel. You are right that it's not possible if the vars is locally declared or imported from other files than the params.yaml.
This is more of a coincidence in that --set-params can change params.yaml by default, and so does the templating, so it seems that they work together for that file.
For other files that are referenced, you'd need to do --set-param <filename>:<params>.
I am just assuming here that for the most part, it'll be from params.yaml file.
For other files that are referenced, you'd need to do --set-param
:
Sure, as long as there's a way to generalize this "coincidence" I think we can indeed emphasize it as a feature 👍 (only with param file values though, not vars).
Since it's the cmd ref, would you be able to send a draft PR for this change @skshetry ? Could just copy the example above for now. We'll take over the explanation, formatting, etc. if needed.
Sorry, I won't have any time this week/month.