From 3ee6f0c1f8356f2a3863f60f6bad409f71743e49 Mon Sep 17 00:00:00 2001 From: sangseconds <82400654+sangseconds@users.noreply.github.com> Date: Wed, 22 Nov 2023 08:18:02 +0700 Subject: [PATCH 01/10] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b4a3372bd..3115634f5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ pandas -sklearn +scikit-learn matplotlib seaborn numpy From 3c8d313a4288fa75acd1d678ae10b2a6bfa7e7ec Mon Sep 17 00:00:00 2001 From: sangseconds <82400654+sangseconds@users.noreply.github.com> Date: Wed, 22 Nov 2023 08:20:41 +0700 Subject: [PATCH 02/10] Create cml.yaml --- .github/workflows/cml.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 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..f79f2aa1f --- /dev/null +++ b/.github/workflows/cml.yaml @@ -0,0 +1,29 @@ +name: your-workflow-name +on: [push] +jobs: + run: + runs-on: ubuntu-latest + # optionally use a convenient Ubuntu LTS + DVC + CML image + container: ghcr.io/iterative/cml:0-dvc2-base1 + steps: + - uses: actions/checkout@v3 + # may need to setup NodeJS & Python3 on e.g. self-hosted + # - uses: actions/setup-node@v3 + # with: + # node-version: '16' + # - uses: actions/setup-python@v4 + # 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 train.py + - name: Write CML report + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Post reports as comments in GitHub PRs + cat results.txt >> report.md + cml comment create report.md From 79d2b812fdf8e9576af59465e09f2c6080d241d8 Mon Sep 17 00:00:00 2001 From: sangseconds <82400654+sangseconds@users.noreply.github.com> Date: Wed, 22 Nov 2023 08:22:44 +0700 Subject: [PATCH 03/10] Update train.py --- train.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/train.py b/train.py index 25a64304f..9741804e9 100644 --- a/train.py +++ b/train.py @@ -1,6 +1,6 @@ import pandas as pd -from sklearn.model_selection import train_test_split -from sklearn.ensemble import RandomForestRegressor +from scikit-learn.model_selection import train_test_split +from scikit-learn.ensemble import RandomForestRegressor import matplotlib.pyplot as plt import seaborn as sns import numpy as np From c073c7fc57ef311668012a9a8f44446d9360b3c8 Mon Sep 17 00:00:00 2001 From: sangseconds <82400654+sangseconds@users.noreply.github.com> Date: Wed, 22 Nov 2023 08:26:52 +0700 Subject: [PATCH 04/10] Update cml.yaml --- .github/workflows/cml.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index f79f2aa1f..0bfea884c 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -16,14 +16,12 @@ jobs: # python-version: '3.x' - uses: iterative/setup-cml@v1 - name: Train model + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Your ML workflow goes here pip install -r requirements.txt python train.py - - name: Write CML report - env: - REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # Post reports as comments in GitHub PRs - cat results.txt >> report.md - cml comment create report.md + + echo "MODEL METRICS" + cat metrics.txt From 29e7c371f00530b69a475c4958eccb6bf3a2196c Mon Sep 17 00:00:00 2001 From: sangseconds <82400654+sangseconds@users.noreply.github.com> Date: Wed, 22 Nov 2023 08:28:54 +0700 Subject: [PATCH 05/10] Update train.py --- train.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/train.py b/train.py index 9741804e9..25a64304f 100644 --- a/train.py +++ b/train.py @@ -1,6 +1,6 @@ import pandas as pd -from scikit-learn.model_selection import train_test_split -from scikit-learn.ensemble import RandomForestRegressor +from sklearn.model_selection import train_test_split +from sklearn.ensemble import RandomForestRegressor import matplotlib.pyplot as plt import seaborn as sns import numpy as np From ccf4eec57f6485e704e958bdc50b4b4c7ba058cc Mon Sep 17 00:00:00 2001 From: sangseconds <82400654+sangseconds@users.noreply.github.com> Date: Wed, 22 Nov 2023 08:39:22 +0700 Subject: [PATCH 06/10] Update cml.yaml --- .github/workflows/cml.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 0bfea884c..932866ac8 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -23,5 +23,9 @@ jobs: pip install -r requirements.txt python train.py - echo "MODEL METRICS" - cat metrics.txt + echo "##MODEL METRICS" > report.md + cat metrics.txt >> report.md + + echo "## Data viz" >> report.md + cml-publish feature_importance.png --md >> report.md + cmlpublish residual.png --md >> report.md From 0ab00f3412dc7260685e4efe656d50a436b760f5 Mon Sep 17 00:00:00 2001 From: sangseconds <82400654+sangseconds@users.noreply.github.com> Date: Wed, 22 Nov 2023 08:40:16 +0700 Subject: [PATCH 07/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 932866ac8..ea9c47b3e 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -29,3 +29,5 @@ jobs: echo "## Data viz" >> report.md cml-publish feature_importance.png --md >> report.md cmlpublish residual.png --md >> report.md + + cml-send-comment report.md From ac070c2e52296b4b0b22ab06a63e7c80c08f40a9 Mon Sep 17 00:00:00 2001 From: sangseconds <82400654+sangseconds@users.noreply.github.com> Date: Wed, 22 Nov 2023 08:41:31 +0700 Subject: [PATCH 08/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 ea9c47b3e..85e91960b 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -28,6 +28,6 @@ jobs: echo "## Data viz" >> report.md cml-publish feature_importance.png --md >> report.md - cmlpublish residual.png --md >> report.md + cml-publish residual.png --md >> report.md cml-send-comment report.md From e70133043325fff8d891edea6264ea1385762901 Mon Sep 17 00:00:00 2001 From: sangseconds <82400654+sangseconds@users.noreply.github.com> Date: Wed, 22 Nov 2023 09:07:05 +0700 Subject: [PATCH 09/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 85e91960b..50279e55e 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -23,7 +23,7 @@ jobs: pip install -r requirements.txt python train.py - echo "##MODEL METRICS" > report.md + echo "## MODEL METRICS" > report.md cat metrics.txt >> report.md echo "## Data viz" >> report.md From 6a7388dbbf2c487b04e8444a2d76535925352238 Mon Sep 17 00:00:00 2001 From: sangseconds <82400654+sangseconds@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:22:02 +0700 Subject: [PATCH 10/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 50279e55e..cf0a62348 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -28,6 +28,6 @@ jobs: echo "## Data viz" >> report.md cml-publish feature_importance.png --md >> report.md - cml-publish residual.png --md >> report.md + cml-publish residuals.png --md >> report.md cml-send-comment report.md