From dacca14e05cfcfe50bf779beb7276c57a10d2b62 Mon Sep 17 00:00:00 2001 From: Cedric Klinkert Date: Mon, 24 Oct 2022 17:20:11 +0200 Subject: [PATCH] modify depth --- .github/workflows/cml.yml | 21 +++++++++++++++++++++ train.py | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cml.yml diff --git a/.github/workflows/cml.yml b/.github/workflows/cml.yml new file mode 100644 index 000000000..e2be4b8de --- /dev/null +++ b/.github/workflows/cml.yml @@ -0,0 +1,21 @@ +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 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Train model + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pip install -r requirements.txt + python train.py + + # Create CML report + cat metrics.txt >> report.md + echo '![](./plot.png)' >> report.md + cml comment create report.md 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)