diff --git a/content/docs/command-reference/exp/apply.md b/content/docs/command-reference/exp/apply.md index b7d11f77871..b0220f32a57 100644 --- a/content/docs/command-reference/exp/apply.md +++ b/content/docs/command-reference/exp/apply.md @@ -39,12 +39,13 @@ the current Git commit. - `-v`, `--verbose` - displays detailed tracing information from executing the `dvc pull` command. -## Example: Apply and promote an experiment +## Example: Make an experiment persistent > This example is based on our > [Get Started](/doc/tutorials/get-started/experiments), where you can find the -> actual source code. Let's say we have run 3 experiments in our project -> workspace: +> actual source code. + +Let's say we have run 3 experiments in our project: ```dvc $ dvc exp show --include-params=featurize @@ -59,50 +60,37 @@ $ dvc exp show --include-params=featurize └───────────────────────┴──────────────┴─────────┴────────────────────────┴──────────────────┘ ``` -We now wish to commit the results of experiment `1dad0d2` into our project. +Since `exp-e6c97` has the best `auc`, we may want to commit it into our project +(this is what we call to "make it persistent"): ```dvc $ dvc exp apply exp-1dad0 -Changes for experiment 'exp-1dad0' have been applied to your current workspace. +Changes for experiment 'exp-1dad0' have been applied... ``` -We can inspect these changes with Git: +We can inspect what changed in the workspace with Git, ```dvc $ git status On branch master -Your branch is up to date with 'origin/master'. Changes not staged for commit: modified: dvc.lock modified: params.yaml - modified: prc.json modified: scores.json -$ git diff params.yaml scores.json -diff --git a/params.yaml b/params.yaml -index 4c4d898..faf781a 100644 ---- a/params.yaml -+++ b/params.yaml +$ git diff params.yaml +``` + +```git @@ -3,7 +3,7 @@ prepare: - seed: 20170428 featurize: -- max_features: 1500 -+ max_features: 2000 +- max_features: 2000 ++ max_features: 1500 ngrams: 2 - train: -diff --git a/scores.json b/scores.json -index c995f24..c640c4e 100644 ---- a/scores.json -+++ b/scores.json -@@ -1 +1 @@ --{"auc": 0.6131382960762474} -\ No newline at end of file -+{"auc": 0.5775633054725381} -\ No newline at end of file ``` and with DVC: -``` +```dvc $ dvc status Data and pipelines are up to date. $ dvc diff @@ -111,21 +99,17 @@ Modified: data/features/test.pkl data/features/train.pkl model.pkl - prc.json - scores.json -files summary: 0 added, 0 deleted, 5 modified, 0 not in cache +files summary: 0 added, 0 deleted, 3 modified, 0 not in cache ``` -To promote this experiment we simply `git add` and `git commit` the changes: +To finish making this experiment persistent, we commit the changes to the repo: ```dvc $ git add . -$ git commit -m "promote experiment exp-1dad0" -[master 0412386] promote experiment exp-1dad0 +$ git commit -m "persist exp-1dad0" ``` -Finally, we can now see that the promoted experiment is the new tip of our -master branch: +We can now see that the experiment is the new tip of our master branch: ```dvc $ dvc exp show --include-params=featurize @@ -136,3 +120,6 @@ $ dvc exp show --include-params=featurize │ master │ 04:31 PM │ 0.57756 │ 2000 │ 2 │ └────────────┴──────────┴─────────┴────────────────────────┴──────────────────┘ ``` + +Note that all the other experiments are based on a previous commit, so +`dvc exp show` won't display them by default (but they're still saved).