Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions .github/workflows/train.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,34 @@ on: [push]
jobs:
run:
runs-on: [ubuntu-latest]
container: docker://dvcorg/cml-py3:latest
container: docker://dvcorg/cml:latest
steps:
- uses: actions/checkout@v2

- name: Set safe directory
run: git config --global --add safe.directory /__w/githubactionsml/githubactionsml

- name: Set up Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"

- name: cml_run
env:
repo_token: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install -r requirements.txt
dvc repro

git fetch --prune
dvc metrics diff --show-md master > report.md

echo "## DVC metrics comparison" >> report.md
dvc metrics diff main >> report.md
# Add figure to the report
echo "## Validating results by region"
echo "## Validating results by region" >> report.md
cml-publish by_region.png --md >> report.md
cml-send-comment report.md
cml-send-comment report.md

- name: Commit DVC changes
run: |
git add dvc.lock
git commit -m "Update DVC lock file" || echo "No changes to commit"
git push
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
wget
sklearn
scikit-learn
pandas
seaborn
matplotlib
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
# Bar plot by region

sns.set_color_codes("dark")
ax = sns.barplot(x="region", y="pred_accuracy", data=df, palette = "Greens_d")
ax = sns.barplot(x="region", y="pred_accuracy", hue="region", data=df, palette="Greens_d", legend=False)
ax.set(xlabel="Region", ylabel = "Model accuracy")
plt.savefig("by_region.png",dpi=80)