Run experiments tuning random forest params #159
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CML Report | |
on: pull_request | |
jobs: | |
run: | |
runs-on: [ubuntu-latest] | |
steps: | |
- uses: iterative/setup-cml@v2 | |
- uses: iterative/setup-dvc@v1 | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
# Needed for https://github.com/iterative/example-repos-dev/issues/225 | |
- name: Installs JSON5 | |
run: npm install -g json5 | |
- name: Generate metrics report | |
env: | |
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
cml ci | |
if [ $GITHUB_REF = refs/heads/main ]; then | |
PREVIOUS_REF=HEAD~1 | |
else | |
PREVIOUS_REF=main | |
git fetch origin main:main | |
fi | |
dvc pull eval | |
dvc plots diff $PREVIOUS_REF workspace \ | |
--show-vega --targets ROC | json5 > vega.json | |
vl2svg vega.json roc.svg | |
dvc plots diff $PREVIOUS_REF workspace \ | |
--show-vega --targets Precision-Recall | json5 > vega.json | |
vl2svg vega.json prc.svg | |
dvc plots diff $PREVIOUS_REF workspace \ | |
--show-vega --targets Confusion-Matrix | json5 > vega.json | |
vl2svg vega.json confusion.svg | |
cp eval/plots/images/importance.png importance_workspace.png | |
git checkout $PREVIOUS_REF -- dvc.lock | |
cp eval/plots/images/importance.png importance_previous.png | |
dvc_report=$(dvc exp diff $PREVIOUS_REF --md) | |
cat <<EOF > report.md | |
# CML Report | |
## Plots | |
![ROC](./roc.svg) | |
![Precision-Recall](./prc.svg) | |
![Confusion Matrix](./confusion.svg) | |
#### Feature Importance: ${PREVIOUS_REF} | |
![Feature Importance: ${PREVIOUS_REF}](./importance_previous.png) | |
#### Feature Importance: workspace | |
![Feature Importance: workspace](./importance_workspace.png) | |
## Metrics and Params | |
### ${PREVIOUS_REF} → workspace | |
${dvc_report} | |
EOF | |
cml comment create --publish --pr=false report.md |