From bb0b7064d1e3a84744f8b5910199d7c2e10d17b5 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Tue, 26 Dec 2023 20:47:34 +0530 Subject: [PATCH 01/10] modify forest depth --- .github/workflows/cml.yaml | 19 +++++++++++++++++++ train.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) 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..30e129243 --- /dev/null +++ b/.github/workflows/cml.yaml @@ -0,0 +1,19 @@ +name: CML +on: [push] +jobs: + train-and-report: + runs-on: ubuntu-latest + container: docker://ghcr.io/iterative/cml:0-dvc2-base1 + steps: + - uses: actions/checkout@v3 + - name: Train model + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pip install -r requirements.txt + python train.py # generate plot.png + + # Create CML report + cat metrics.txt >> report.md + echo '![](./plot.png "Confusion Matrix")' >> report.md + cml comment create report.md \ No newline at end of file diff --git a/train.py b/train.py index 415d9a9f9..f44634667 100644 --- a/train.py +++ b/train.py @@ -12,7 +12,7 @@ y_test = np.genfromtxt("data/test_labels.csv") # Fit a model -depth = 2 +depth = 5 clf = RandomForestClassifier(max_depth=depth) clf.fit(X_train, y_train) From 264f31a720c0cdb3c6bd9a683b4cd86cfa1432cf Mon Sep 17 00:00:00 2001 From: Abhishek Date: Tue, 26 Dec 2023 20:59:36 +0530 Subject: [PATCH 02/10] modify forest depth --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index f44634667..08d8b32df 100644 --- a/train.py +++ b/train.py @@ -12,7 +12,7 @@ y_test = np.genfromtxt("data/test_labels.csv") # Fit a model -depth = 5 +depth = 4 clf = RandomForestClassifier(max_depth=depth) clf.fit(X_train, y_train) From 1bb73cbdefa1dda375d4c8561a74582f5bb837c9 Mon Sep 17 00:00:00 2001 From: Abhishek-N-D <112235635+Abhishek-N-D@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:31:32 +0530 Subject: [PATCH 03/10] modify forest depth --- .github/workflows/cml.yaml | 19 +++++++++++++++++++ train.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) 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..30e129243 --- /dev/null +++ b/.github/workflows/cml.yaml @@ -0,0 +1,19 @@ +name: CML +on: [push] +jobs: + train-and-report: + runs-on: ubuntu-latest + container: docker://ghcr.io/iterative/cml:0-dvc2-base1 + steps: + - uses: actions/checkout@v3 + - name: Train model + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pip install -r requirements.txt + python train.py # generate plot.png + + # Create CML report + cat metrics.txt >> report.md + echo '![](./plot.png "Confusion Matrix")' >> report.md + cml comment create report.md \ No newline at end of file diff --git a/train.py b/train.py index 415d9a9f9..f44634667 100644 --- a/train.py +++ b/train.py @@ -12,7 +12,7 @@ y_test = np.genfromtxt("data/test_labels.csv") # Fit a model -depth = 2 +depth = 5 clf = RandomForestClassifier(max_depth=depth) clf.fit(X_train, y_train) From a85e67956c59612138b7022ae3a946c760dde197 Mon Sep 17 00:00:00 2001 From: Abhishek-N-D <112235635+Abhishek-N-D@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:37:05 +0530 Subject: [PATCH 04/10] Update train.py --- train.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/train.py b/train.py index 5521a5a8f..f44634667 100644 --- a/train.py +++ b/train.py @@ -12,11 +12,7 @@ y_test = np.genfromtxt("data/test_labels.csv") # Fit a model -<<<<<<< HEAD depth = 5 -======= -depth = 4 ->>>>>>> 264f31a720c0cdb3c6bd9a683b4cd86cfa1432cf clf = RandomForestClassifier(max_depth=depth) clf.fit(X_train, y_train) From c9c93716fd5af55e194fccb17839ace3add989cd Mon Sep 17 00:00:00 2001 From: Abhishek-N-D <112235635+Abhishek-N-D@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:41:16 +0530 Subject: [PATCH 05/10] Update cml.yaml --- .github/workflows/cml.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 30e129243..59bb0e655 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -15,5 +15,5 @@ jobs: # Create CML report cat metrics.txt >> report.md - echo '![](./plot.png "Confusion Matrix")' >> report.md - cml comment create report.md \ No newline at end of file + echo '!(./plot.png "Confusion Matrix")' >> report.md + cml comment create report.md From 626f0bfa27038f745a5f7c88da89615ca50cbcd4 Mon Sep 17 00:00:00 2001 From: Abhishek-N-D <112235635+Abhishek-N-D@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:47:23 +0530 Subject: [PATCH 06/10] Added img --- .github/workflows/cml.yaml | 2 +- train.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml index 30e129243..ed6ab287a 100644 --- a/.github/workflows/cml.yaml +++ b/.github/workflows/cml.yaml @@ -15,5 +15,5 @@ jobs: # Create CML report cat metrics.txt >> report.md - echo '![](./plot.png "Confusion Matrix")' >> report.md + echo '!(./plot.png "Confusion Matrix")' >> report.md cml comment create report.md \ No newline at end of file diff --git a/train.py b/train.py index 5521a5a8f..fd01df0f6 100644 --- a/train.py +++ b/train.py @@ -12,11 +12,9 @@ y_test = np.genfromtxt("data/test_labels.csv") # Fit a model -<<<<<<< HEAD -depth = 5 -======= + depth = 4 ->>>>>>> 264f31a720c0cdb3c6bd9a683b4cd86cfa1432cf + clf = RandomForestClassifier(max_depth=depth) clf.fit(X_train, y_train) From 53c55db2ad297be5386bc2610cf407dc25824d3f Mon Sep 17 00:00:00 2001 From: Abhishek-N-D <112235635+Abhishek-N-D@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:49:33 +0530 Subject: [PATCH 07/10] Update train.py --- train.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/train.py b/train.py index 27df1008e..236750b14 100644 --- a/train.py +++ b/train.py @@ -12,13 +12,9 @@ y_test = np.genfromtxt("data/test_labels.csv") # Fit a model -<<<<<<< HEAD -depth = 4 - -======= depth = 5 ->>>>>>> c9c93716fd5af55e194fccb17839ace3add989cd + clf = RandomForestClassifier(max_depth=depth) clf.fit(X_train, y_train) From b4871b723f4883ac07085fed8b326e03fcdf21ee Mon Sep 17 00:00:00 2001 From: Abhishek-N-D <112235635+Abhishek-N-D@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:50:27 +0530 Subject: [PATCH 08/10] Update train.py twice --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index 236750b14..a20da1181 100644 --- a/train.py +++ b/train.py @@ -13,7 +13,7 @@ # Fit a model -depth = 5 +depth = 3 clf = RandomForestClassifier(max_depth=depth) clf.fit(X_train, y_train) From 36cf661cd834bc6211d7e90e889c93e33895952c Mon Sep 17 00:00:00 2001 From: Abhishek-N-D <112235635+Abhishek-N-D@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:52:21 +0530 Subject: [PATCH 09/10] change depth --- train.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/train.py b/train.py index a20da1181..ba4c71e7e 100644 --- a/train.py +++ b/train.py @@ -13,7 +13,8 @@ # Fit a model -depth = 3 +depth = 5 + clf = RandomForestClassifier(max_depth=depth) clf.fit(X_train, y_train) From 8623e2be85f2b68f8b6a70b0ebda781fa3b55b15 Mon Sep 17 00:00:00 2001 From: Abhishek-N-D <112235635+Abhishek-N-D@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:53:43 +0530 Subject: [PATCH 10/10] Update train.py --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index ba4c71e7e..d3ed33a14 100644 --- a/train.py +++ b/train.py @@ -13,7 +13,7 @@ # Fit a model -depth = 5 +depth = 3 clf = RandomForestClassifier(max_depth=depth)