From 29d880e55e901fd5c847464392eec95ea98bc0df Mon Sep 17 00:00:00 2001 From: Kristian Tanggaard Date: Mon, 15 Nov 2021 10:09:38 +0100 Subject: [PATCH 1/4] modify forest depth --- .github/workflows/cml.yaml | 18 ++++++++++++++++++ .gitignore | 2 ++ train.py | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cml.yaml create mode 100644 .gitignore diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml new file mode 100644 index 000000000..813e4b0d9 --- /dev/null +++ b/.github/workflows/cml.yaml @@ -0,0 +1,18 @@ +name: CML +on: [push] +jobs: + run: + runs-on: ubuntu-latest + container: docker://ghcr.io/iterative/cml:0-dvc2-base1 + steps: + - uses: actions/checkout@v2 + - name: Train model + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pip install -r requirements.txt + python train.py + + cat metrics.txt >> report.md + cml publish confusion_matrix.png --md >> report.md + cml send-comment report.md \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..df309478b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +.idea/ diff --git a/train.py b/train.py index f7ea25d3a..b7ae23ad0 100644 --- a/train.py +++ b/train.py @@ -13,7 +13,7 @@ # Fit a model -depth = 2 +depth = 5 clf = RandomForestClassifier(max_depth=depth) clf.fit(X_train,y_train) From c75ab8f3ee6f2df0bb2f2d5add67bb3d409f0923 Mon Sep 17 00:00:00 2001 From: Kristian Tanggaard Date: Mon, 15 Nov 2021 10:32:58 +0100 Subject: [PATCH 2/4] Change depth --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index b7ae23ad0..1df8d7f9a 100644 --- a/train.py +++ b/train.py @@ -13,7 +13,7 @@ # Fit a model -depth = 5 +depth = 6 clf = RandomForestClassifier(max_depth=depth) clf.fit(X_train,y_train) From 4fd200ca1886a8d40570bc9731579f3171491c8f Mon Sep 17 00:00:00 2001 From: Kristian Tanggaard Date: Mon, 15 Nov 2021 10:39:24 +0100 Subject: [PATCH 3/4] fix typo --- .github/workflows/cml.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 813e4b0d9..108966a32 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -7,12 +7,12 @@ jobs: steps: - uses: actions/checkout@v2 - name: Train model - env: - REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - pip install -r requirements.txt - python train.py + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pip install -r requirements.txt + python train.py - cat metrics.txt >> report.md - cml publish confusion_matrix.png --md >> report.md - cml send-comment report.md \ No newline at end of file + cat metrics.txt >> report.md + cml publish confusion_matrix.png --md >> report.md + cml send-comment report.md \ No newline at end of file From 9507f51e33c8962958383793fda1ee25a0dacf27 Mon Sep 17 00:00:00 2001 From: Kristian Tanggaard Date: Mon, 15 Nov 2021 10:40:18 +0100 Subject: [PATCH 4/4] fix typo --- .github/workflows/cml.yaml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 108966a32..a50b43f35 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -1,18 +1,19 @@ -name: CML +name: model-training on: [push] jobs: run: - runs-on: ubuntu-latest - container: docker://ghcr.io/iterative/cml:0-dvc2-base1 - steps: - - uses: actions/checkout@v2 - - name: Train model + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: iterative/setup-cml@v1 + - name: Train model env: - REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - pip install -r requirements.txt - python train.py + pip install -r requirements.txt + python train.py - cat metrics.txt >> report.md - cml publish confusion_matrix.png --md >> report.md - cml send-comment report.md \ No newline at end of file + cat metrics.txt >> report.md + cml-publish confusion_matrix.png --md >> report.md + cml-send-comment report.md \ No newline at end of file