From aca6b52395a5cfd6d680a6c7e6a4ab60fd06f848 Mon Sep 17 00:00:00 2001 From: joa24jm <73597706+joa24jm@users.noreply.github.com> Date: Wed, 21 Apr 2021 12:54:16 +0200 Subject: [PATCH 01/14] Create cml.yaml --- .github/workflows/cml.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/cml.yaml diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml new file mode 100644 index 000000000..517505b7a --- /dev/null +++ b/.github/workflows/cml.yaml @@ -0,0 +1,19 @@ +name: model_wine_quality +on: [push] +jobs: + run: + runs-on: [Windows 10 Education] # I have windows, does this matter? + container: docker://dvcorg/cml-py3:latest + steps: + - uses: actions/checkout@v2 + - name: cml_run + - env: + repo_token: ${{ secrets.GITHUB_TOKEN }} + run: + + # Your ML workflow goes here + pip install -r requirements.txt + python train.py + + echo "model metrics" + cat metrics.txt From fbbd905503359667cf52651971997ac8a96fbf6b Mon Sep 17 00:00:00 2001 From: joa24jm <73597706+joa24jm@users.noreply.github.com> Date: Wed, 21 Apr 2021 13:02:09 +0200 Subject: [PATCH 02/14] try different yaml file first one did not work --- .github/workflows/cml.yaml | 43 ++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 517505b7a..71d4682f7 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -1,19 +1,30 @@ -name: model_wine_quality +name: wine-quality-model on: [push] jobs: run: - runs-on: [Windows 10 Education] # I have windows, does this matter? - container: docker://dvcorg/cml-py3:latest - steps: - - uses: actions/checkout@v2 - - name: cml_run - - env: - repo_token: ${{ secrets.GITHUB_TOKEN }} - run: - - # Your ML workflow goes here - pip install -r requirements.txt - python train.py - - echo "model metrics" - cat metrics.txt + runs-on: [ubuntu-latest] + container: docker://ubuntu:latest + steps: + - uses: actions/setup-node@v1 + with: + node-version: '12' + - uses: actions/checkout@v2 + - name: cml_run + env: + repo_token: ${{ secrets.GITHUB_TOKEN }} + run: | + # Your ML workflow goes here + apt update && apt install -y python3 python3-pip python3-setuptools + npm i -g @dvcorg/cml + # npm install -g vega-cli vega-lite + pip3 install -r requirements.txt + python3 train.py + + echo "## Model metrics" > report.md + cat metrics.txt >> report.md + + echo "## Data viz" >> report.md + cml-publish feature_importance.png --md >> report.md + cml-publish residuals.png --md >> report.md + + cml-send-comment report.md From 35230dfa7ef6e965a55776cb2468375b52195ab5 Mon Sep 17 00:00:00 2001 From: joa24jm <73597706+joa24jm@users.noreply.github.com> Date: Wed, 21 Apr 2021 13:21:10 +0200 Subject: [PATCH 03/14] try to fix yaml --- .github/workflows/cml.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 71d4682f7..172b23650 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -1,9 +1,8 @@ name: wine-quality-model -on: [push] +on: push jobs: run: - runs-on: [ubuntu-latest] - container: docker://ubuntu:latest + runs-on: [windows-latest] steps: - uses: actions/setup-node@v1 with: From 5045e34ec9a78f8ef48caf8cbd2db89ec6542c5a Mon Sep 17 00:00:00 2001 From: joa24jm <73597706+joa24jm@users.noreply.github.com> Date: Wed, 21 Apr 2021 15:55:52 +0200 Subject: [PATCH 04/14] try to fix cml.yaml copy-pasted directly from https://github.com/iterative/cml --- .github/workflows/cml.yaml | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 172b23650..45f0f147e 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -1,29 +1,18 @@ -name: wine-quality-model -on: push +name: model-training +on: [push] jobs: run: runs-on: [windows-latest] + container: docker://dvcorg/cml-py3:latest steps: - - uses: actions/setup-node@v1 - with: - node-version: '12' - uses: actions/checkout@v2 - - name: cml_run + - name: 'Train my model' env: repo_token: ${{ secrets.GITHUB_TOKEN }} run: | - # Your ML workflow goes here - apt update && apt install -y python3 python3-pip python3-setuptools - npm i -g @dvcorg/cml - # npm install -g vega-cli vega-lite - pip3 install -r requirements.txt - python3 train.py - - echo "## Model metrics" > report.md + pip install -r requirements.txt + python train.py + cat metrics.txt >> report.md - - echo "## Data viz" >> report.md - cml-publish feature_importance.png --md >> report.md - cml-publish residuals.png --md >> report.md - + cml-publish confusion_matrix.png --md >> report.md cml-send-comment report.md From 448b3bcb9a0fd44b46aa006b92766f5b68d4e0e9 Mon Sep 17 00:00:00 2001 From: joa24jm <73597706+joa24jm@users.noreply.github.com> Date: Wed, 21 Apr 2021 15:58:19 +0200 Subject: [PATCH 05/14] try to fix cml.yaml Container operations are only supported on linx runners? --- .github/workflows/cml.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 45f0f147e..7a3e68bf3 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -2,7 +2,7 @@ name: model-training on: [push] jobs: run: - runs-on: [windows-latest] + runs-on: [linux-latest] container: docker://dvcorg/cml-py3:latest steps: - uses: actions/checkout@v2 From 48bd276309594761b1d78f7f4e239f30c279b8ca Mon Sep 17 00:00:00 2001 From: joa24jm <73597706+joa24jm@users.noreply.github.com> Date: Wed, 21 Apr 2021 16:10:13 +0200 Subject: [PATCH 06/14] try to fix yaml --- .github/workflows/cml.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 7a3e68bf3..45f0f147e 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -2,7 +2,7 @@ name: model-training on: [push] jobs: run: - runs-on: [linux-latest] + runs-on: [windows-latest] container: docker://dvcorg/cml-py3:latest steps: - uses: actions/checkout@v2 From 5873a6cd6859f34343e6da123b97767258e6c736 Mon Sep 17 00:00:00 2001 From: joa24jm <73597706+joa24jm@users.noreply.github.com> Date: Wed, 21 Apr 2021 16:27:22 +0200 Subject: [PATCH 07/14] fix yml --- .github/workflows/cml.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 45f0f147e..0f69f8b77 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -2,8 +2,7 @@ name: model-training on: [push] jobs: run: - runs-on: [windows-latest] - container: docker://dvcorg/cml-py3:latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: 'Train my model' From 8da31731aec76bbfac6223d12aad6e14a3fa3442 Mon Sep 17 00:00:00 2001 From: joa24jm <73597706+joa24jm@users.noreply.github.com> Date: Wed, 21 Apr 2021 16:32:53 +0200 Subject: [PATCH 08/14] update --- .github/workflows/cml.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 0f69f8b77..61873b3a7 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -13,5 +13,4 @@ jobs: python train.py cat metrics.txt >> report.md - cml-publish confusion_matrix.png --md >> report.md cml-send-comment report.md From 8c38b38f01e6a895f8aee4004e18fce8f09154f8 Mon Sep 17 00:00:00 2001 From: joa24jm <73597706+joa24jm@users.noreply.github.com> Date: Wed, 21 Apr 2021 16:34:41 +0200 Subject: [PATCH 09/14] remove cml commands in python part --- .github/workflows/cml.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 61873b3a7..74f053d7d 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -13,4 +13,3 @@ jobs: python train.py cat metrics.txt >> report.md - cml-send-comment report.md From a74b8b158aa9616ed6306ec1c0e3528e5d9aed6f Mon Sep 17 00:00:00 2001 From: joa24jm <73597706+joa24jm@users.noreply.github.com> Date: Wed, 21 Apr 2021 16:40:34 +0200 Subject: [PATCH 10/14] update yaml fix yaml with container included --- .github/workflows/cml.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 74f053d7d..f2b036e72 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -1,15 +1,19 @@ -name: model-training +name: model_wine_quality on: [push] jobs: run: - runs-on: ubuntu-latest + runs-on: [ubuntu-latest] + container: docker://dvcorg/cml-py3:latest steps: - uses: actions/checkout@v2 - name: 'Train my model' env: repo_token: ${{ secrets.GITHUB_TOKEN }} run: | + + # Your ML workflow goes here pip install -r requirements.txt python train.py - - cat metrics.txt >> report.md + + echo "MODEL METRICS" + cat metrics.txt From f9d8f3dd2942bdd26e8c42296b56e27bb4a4a762 Mon Sep 17 00:00:00 2001 From: joa24jm <73597706+joa24jm@users.noreply.github.com> Date: Thu, 22 Apr 2021 14:39:23 +0200 Subject: [PATCH 11/14] Update cml.yaml --- .github/workflows/cml.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index f2b036e72..67b6b55d5 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -15,5 +15,12 @@ jobs: pip install -r requirements.txt python train.py - echo "MODEL METRICS" - cat metrics.txt + # cml helps to write into a .md document + echo "## MODEL METRICS" > report.md + cat metrics.txt >> report.md + + echo "## Data Vizualisation"" >> report.md + cml-publish feature_importance.png --md >> report.md + + cml-send-comment report.md + cml-publish residuals.png --md >> report.md From 82c372edce17b30823d3276ab8f9970ec9e8f78c Mon Sep 17 00:00:00 2001 From: joa24jm <73597706+joa24jm@users.noreply.github.com> Date: Thu, 22 Apr 2021 14:43:37 +0200 Subject: [PATCH 12/14] Update cml.yaml --- .github/workflows/cml.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 67b6b55d5..34c7a9657 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -19,7 +19,7 @@ jobs: echo "## MODEL METRICS" > report.md cat metrics.txt >> report.md - echo "## Data Vizualisation"" >> report.md + echo "## Data Vizualisation" >> report.md cml-publish feature_importance.png --md >> report.md cml-send-comment report.md From f5bd4cce0d3c400445150e4b659fa602d764a261 Mon Sep 17 00:00:00 2001 From: joa24jm <73597706+joa24jm@users.noreply.github.com> Date: Thu, 22 Apr 2021 14:48:34 +0200 Subject: [PATCH 13/14] update max_depth --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index 25a64304f..92678f346 100644 --- a/train.py +++ b/train.py @@ -23,7 +23,7 @@ ################################# # Fit a model on the train section -regr = RandomForestRegressor(max_depth=2, random_state=seed) +regr = RandomForestRegressor(max_depth=5, random_state=seed) regr.fit(X_train, y_train) # Report training set score From acf59e2e408724d2a54c9bc3bb2a2fd598de78be Mon Sep 17 00:00:00 2001 From: joa24jm <73597706+joa24jm@users.noreply.github.com> Date: Thu, 22 Apr 2021 14:52:13 +0200 Subject: [PATCH 14/14] Update cml.yaml --- .github/workflows/cml.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 34c7a9657..63973ea27 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -21,6 +21,6 @@ jobs: echo "## Data Vizualisation" >> report.md cml-publish feature_importance.png --md >> report.md + cml-publish residuals.png --md >> report.md cml-send-comment report.md - cml-publish residuals.png --md >> report.md