From ed206ffff831134f7fef96321dc55b487bd37c72 Mon Sep 17 00:00:00 2001 From: codehering <64325723+codehering@users.noreply.github.com> Date: Mon, 24 Jan 2022 22:14:30 +0100 Subject: [PATCH 01/10] Create cml.yaml --- .github/workflows/cml.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 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 0000000..d2c94ee --- /dev/null +++ b/.github/workflows/cml.yaml @@ -0,0 +1,22 @@ +name: model-pipeline +on: [push] +jobs: + run: + runs-on: ubuntu-latest + # optionally use a convenient Ubuntu LTS + DVC + CML image + # container: docker://ghcr.io/iterative/cml:0-dvc2-base1 + steps: + - uses: actions/checkout@v2 + # may need to setup NodeJS & Python3 on e.g. self-hosted + # - uses: actions/setup-node@v2 + # with: + # node-version: '16' + # - uses: actions/setup-python@v2 + # with: + # python-version: '3.x' + - uses: iterative/setup-cml@v1 + - name: Train model + run: | + # Your ML workflow goes here + pip install -r requirements.txt + python model.py From 476821254d5c26b36e4f1be8ddea29a35a4cf916 Mon Sep 17 00:00:00 2001 From: codehering <64325723+codehering@users.noreply.github.com> Date: Mon, 24 Jan 2022 22:37:48 +0100 Subject: [PATCH 02/10] Update cml.yaml --- .github/workflows/cml.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index d2c94ee..11c6535 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -20,3 +20,5 @@ jobs: # Your ML workflow goes here pip install -r requirements.txt python model.py + echo "## Model metrics" > report.md + cat metrics.txt >> report.md From 3fbcf3bdd70eb1d5eb1b7ec6ab605b05431a7e98 Mon Sep 17 00:00:00 2001 From: codehering <64325723+codehering@users.noreply.github.com> Date: Mon, 24 Jan 2022 22:38:37 +0100 Subject: [PATCH 03/10] Update cml.yaml --- .github/workflows/cml.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 11c6535..a754d01 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -22,3 +22,4 @@ jobs: python model.py echo "## Model metrics" > report.md cat metrics.txt >> report.md + cml-send comment report.md From a125ab2b8d0c3c3bfc6e5c2d19c6d297909a7499 Mon Sep 17 00:00:00 2001 From: codehering <64325723+codehering@users.noreply.github.com> Date: Mon, 24 Jan 2022 22:40:21 +0100 Subject: [PATCH 04/10] Update model.py --- model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/model.py b/model.py index 0176995..63f2cff 100644 --- a/model.py +++ b/model.py @@ -16,3 +16,5 @@ print(results.summary()) print('Parameters: ', results.params) print('R2: ', results.rsquared) +with open ("metrics.txt", "w") as f: + f.write(f"results.summary()") From e4e0e9edd11b44bcb299c5258831858ab8de700e Mon Sep 17 00:00:00 2001 From: codehering <64325723+codehering@users.noreply.github.com> Date: Mon, 24 Jan 2022 22:44:15 +0100 Subject: [PATCH 05/10] 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 a754d01..14ad9fe 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -22,4 +22,4 @@ jobs: python model.py echo "## Model metrics" > report.md cat metrics.txt >> report.md - cml-send comment report.md + cml-send-comment report.md From c80ae2a4468b2fe0008901e45b114211ad5c8049 Mon Sep 17 00:00:00 2001 From: codehering <64325723+codehering@users.noreply.github.com> Date: Mon, 24 Jan 2022 22:50:32 +0100 Subject: [PATCH 06/10] Update cml.yaml --- .github/workflows/cml.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 14ad9fe..c582418 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -16,6 +16,8 @@ jobs: # python-version: '3.x' - uses: iterative/setup-cml@v1 - name: Train model + env: + REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} run: | # Your ML workflow goes here pip install -r requirements.txt From 9049b05d7774aac935bc1a6d19559253231703f7 Mon Sep 17 00:00:00 2001 From: codehering <64325723+codehering@users.noreply.github.com> Date: Mon, 24 Jan 2022 22:57:15 +0100 Subject: [PATCH 07/10] 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 c582418..f138572 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -17,7 +17,7 @@ jobs: - uses: iterative/setup-cml@v1 - name: Train model env: - REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Your ML workflow goes here pip install -r requirements.txt From f5bdaddddb79af40c583307547465fd5ecd059f2 Mon Sep 17 00:00:00 2001 From: codehering <64325723+codehering@users.noreply.github.com> Date: Mon, 24 Jan 2022 23:01:10 +0100 Subject: [PATCH 08/10] Update model.py --- model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model.py b/model.py index 63f2cff..b625731 100644 --- a/model.py +++ b/model.py @@ -17,4 +17,4 @@ print('Parameters: ', results.params) print('R2: ', results.rsquared) with open ("metrics.txt", "w") as f: - f.write(f"results.summary()") + f.write(f"{results.summary()}") From 265ff1943798c56070d00bf3c0821c785e60e111 Mon Sep 17 00:00:00 2001 From: codehering <64325723+codehering@users.noreply.github.com> Date: Mon, 24 Jan 2022 23:07:17 +0100 Subject: [PATCH 09/10] Update model.py --- model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model.py b/model.py index b625731..3779989 100644 --- a/model.py +++ b/model.py @@ -17,4 +17,4 @@ print('Parameters: ', results.params) print('R2: ', results.rsquared) with open ("metrics.txt", "w") as f: - f.write(f"{results.summary()}") + f.write(f"{results.summary().as_text()}") From 53f3562b3ef8a93399543c343b957bbc2c3eeefa Mon Sep 17 00:00:00 2001 From: codehering <64325723+codehering@users.noreply.github.com> Date: Mon, 24 Jan 2022 23:09:24 +0100 Subject: [PATCH 10/10] Update model.py --- model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model.py b/model.py index 3779989..e1fa9d4 100644 --- a/model.py +++ b/model.py @@ -17,4 +17,4 @@ print('Parameters: ', results.params) print('R2: ', results.rsquared) with open ("metrics.txt", "w") as f: - f.write(f"{results.summary().as_text()}") + f.write(f"{results.summary().as_html()}")