diff --git a/.github/workflows/cml.yaml b/.github/workflows/cml.yaml new file mode 100644 index 000000000..b33242015 --- /dev/null +++ b/.github/workflows/cml.yaml @@ -0,0 +1,23 @@ +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 +<<<<<<< HEAD + cml comment create report.md +======= + cml comment create report.md +>>>>>>> c9c93716fd5af55e194fccb17839ace3add989cd diff --git a/train.py b/train.py index 415d9a9f9..d3ed33a14 100644 --- a/train.py +++ b/train.py @@ -12,7 +12,10 @@ y_test = np.genfromtxt("data/test_labels.csv") # Fit a model -depth = 2 + +depth = 3 + + clf = RandomForestClassifier(max_depth=depth) clf.fit(X_train, y_train)