Skip to content

Commit

Permalink
fix(example-get-started): cache images, fix reports action (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
shcheklein authored Sep 1, 2023
1 parent f895305 commit b10468b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
8 changes: 4 additions & 4 deletions example-get-started/code/.github/workflows/cml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ jobs:
--show-vega --targets Confusion-Matrix | json5 > vega.json
vl2svg vega.json confusion.svg
dvc pull eval/importance.png
cp eval/importance.png importance_workspace.png
dvc pull eval/plots/images
cp eval/plots/images/importance.png importance_workspace.png
git checkout $PREVIOUS_REF -- dvc.lock
dvc pull eval/importance.png
cp eval/importance.png importance_previous.png
dvc pull eval/plots/images
cp eval/plots/images/importance.png importance_previous.png
dvc_report=$(dvc exp diff $PREVIOUS_REF --md)
Expand Down
2 changes: 1 addition & 1 deletion example-get-started/code/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![DVC](https://img.shields.io/badge/-Open_in_Studio-grey.svg?style=flat-square&logo=dvc)](https://studio.iterative.ai/team/Iterative/views/example-get-started-zde16i6c4g) [![DVC-metrics](https://img.shields.io/badge/dynamic/json?style=flat-square&colorA=grey&colorB=F46737&label=Average%20Precision&url=https://github.com/iterative/example-get-started/raw/main/eval/live/metrics.json&query=avg_prec.test)](https://github.com/iterative/example-get-started/raw/main/eval/live/metrics.json)
[![DVC](https://img.shields.io/badge/-Open_in_Studio-grey.svg?style=flat-square&logo=dvc)](https://studio.iterative.ai/team/Iterative/views/example-get-started-zde16i6c4g) [![DVC-metrics](https://img.shields.io/badge/dynamic/json?style=flat-square&colorA=grey&colorB=F46737&label=Average%20Precision&url=https://github.com/iterative/example-get-started/raw/main/eval/metrics.json&query=avg_prec.test)](https://github.com/iterative/example-get-started/raw/main/eval/metrics.json)

# DVC Get Started

Expand Down
13 changes: 7 additions & 6 deletions example-get-started/code/src/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,14 @@ def main():
test, _ = pickle.load(fd)

# Evaluate train and test datasets.
live = Live(EVAL_PATH)
evaluate(model, train, "train", live, save_path=EVAL_PATH)
evaluate(model, test, "test", live, save_path=EVAL_PATH)
live.make_summary()
with Live(EVAL_PATH, cache_images=True, dvcyaml=False) as live:
evaluate(model, train, "train", live, save_path=EVAL_PATH)
evaluate(model, test, "test", live, save_path=EVAL_PATH)

# Dump feature importance plot.
save_importance_plot(live, model, feature_names)
live.make_summary()

# Dump feature importance plot.
save_importance_plot(live, model, feature_names)


if __name__ == "__main__":
Expand Down

0 comments on commit b10468b

Please sign in to comment.