Skip to content

Commit

Permalink
ADD: Improve evaluation + make CLI runnable (#8)
Browse files Browse the repository at this point in the history
* improve model evaluation

* ADD: compare trials and FIX: last model instead of all

* ADD: CLI runnable functions

* ADD: trial_num to config and different code cov settings

* loosed code cov further

* further relaxed codecov setting during preprod
  • Loading branch information
adamovanja authored Mar 3, 2024
1 parent a094e8e commit c04a710
Show file tree
Hide file tree
Showing 13 changed files with 655 additions and 274 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ dmypy.json
# MLflow model logs
**/mlruns/**

# Best model checkpoints
**/best_models/**
# Model checkpoints
**/models/**

# Sequence and metadata
**/experiments/data/**
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test: all

# todo: adjust coverage threshold once final
test-cov: all
py.test --cov=q2_ritme --cov-report xml:coverage.xml --cov-fail-under=70
py.test --cov=q2_ritme --cov-report xml:coverage.xml --cov-fail-under=30

install: all
$(PYTHON) setup.py install
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,17 @@ make dev
```

## Model training
To train models with a defined configuration in `q2_ritme/config.json` run:
````
python q2_ritme/run_n_eval_tune.py --config q2_ritme/run_config.json
````

Once you have trained some models, you can check the progress of the trained models by launching `mlflow ui --backend-store-uri experiments/mlruns`.

To evaluate the best trial (trial < experiment) of all launched experiments, run:
````
python q2_ritme/eval_best_trial_overall.py --model_path "experiments/models"
````

## Background
### Why ray tune?
Expand Down
8 changes: 5 additions & 3 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
coverage:
precision: 2
round: down
range: "70...100"
range: "30...100"

status:
project:
default:
# Target total project coverage
target: 70%
# todo: increase when prod ready
target: 30%
threshold: 1%
patch:
default:
# Target coverage for changes in PRs
target: 60%
# todo: increase when prod ready
target: 0%
threshold: 1%
9 changes: 9 additions & 0 deletions experiments/ma5_tune.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
"# Try out framework with 5-cohort MA data"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# TODO: delete this notebook (deprecated)"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down
Loading

0 comments on commit c04a710

Please sign in to comment.