Machine Learning Continuous Integration using Github actions. (Using CML Library)
Create a new file in .github/workflows/cml.yml
with the following:
name: first_ML_workflow
on: [push]
jobs:
run:
runs-on: [ubuntu-latest]
container: docker://dvcorg/cml-py3:latest
steps:
- uses: actions/checkout@v2
- name: cml_run
env:
repo_token: ${{ secrets.GITHUB_TOKEN }}
run: |
# Your ML workflow goes here
pip install -r requirements.txt
python train.py
# Write your CML report
# cat results.txt >> report.md
# cml-send-comment report.md
cat metrics.txt >> report.md
echo >> report.md
cml-publish confusion_matrix.png --md --title 'confusion-matrix' >> report.md
cml-send-comment report.md
Now, whenever you commit/push onto GitHub master branch,This workflow will calculate model's accuracy and auto-generate confusion matrix as Commit comment.