Skip to content

Commit

Permalink
🐛 fix issue having same model with 2 configurations
Browse files Browse the repository at this point in the history
- had to set model id ("model_key") as index
  • Loading branch information
Henry committed May 31, 2024
1 parent 4a38df7 commit 83d0aa0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions project/01_2_performance_plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -400,15 +400,15 @@
"outputs": [],
"source": [
"# model_key could be used as key from config file\n",
"? load only specified configs?\n",
"? case: no config file available?\n",
"# ? load only specified configs?\n",
"# ? case: no config file available?\n",
"all_configs = collect(\n",
" paths=(fname for fname in args.out_models.iterdir()\n",
" if fname.suffix == '.yaml'\n",
" and 'model_config' in fname.name),\n",
" load_fn=load_config_file\n",
")\n",
"model_configs = pd.DataFrame(all_configs).set_index('model')\n",
"model_configs = pd.DataFrame(all_configs).set_index('id')\n",
"model_configs.T.to_excel(writer, sheet_name='model_params')\n",
"model_configs.T"
]
Expand Down
6 changes: 3 additions & 3 deletions project/01_2_performance_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@ def build_text(s):

# %% tags=["hide-input"]
# model_key could be used as key from config file
# ? load only specified configs?
# ? case: no config file available?
# # ? load only specified configs?
# # ? case: no config file available?
all_configs = collect(
paths=(fname for fname in args.out_models.iterdir()
if fname.suffix == '.yaml'
and 'model_config' in fname.name),
load_fn=load_config_file
)
model_configs = pd.DataFrame(all_configs).set_index('model')
model_configs = pd.DataFrame(all_configs).set_index('id')
model_configs.T.to_excel(writer, sheet_name='model_params')
model_configs.T

Expand Down
4 changes: 4 additions & 0 deletions project/config/alzheimer_study/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ models:
model: KNN
neighbors: 3
file_format: csv
- KNN5:
model: KNN
neighbors: 5
file_format: csv
NAGuideR_methods:
- BPCA
- COLMEDIAN
Expand Down

0 comments on commit 83d0aa0

Please sign in to comment.