Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create standard/schema for a Model #130

Merged
merged 61 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
85f4cff
closes #120
dilpath Nov 23, 2024
5d8faac
fix tests
dilpath Nov 29, 2024
28da0cd
update notebooks
dilpath Nov 29, 2024
8ef45bb
Merge branch 'develop' into class_models
dilpath Dec 2, 2024
2926e6c
Update petab_select/ui.py
dilpath Dec 2, 2024
b52fa53
Update petab_select/ui.py
dilpath Dec 2, 2024
ffaef40
track iterations; fix `ModelHash.get_model`; add `Model.__repr__`
dilpath Dec 2, 2024
4d8e36f
add analysis module
dilpath Dec 2, 2024
486260b
fixme: use pypesto PR branch
dilpath Dec 2, 2024
e8b8ab9
Merge branch 'develop' into analyze
dilpath Dec 2, 2024
74fed0b
unfix pypesto in tox.ini to use pyproject.toml
dilpath Dec 2, 2024
8e799eb
fix tests
dilpath Dec 3, 2024
7585748
test
dilpath Dec 3, 2024
05d17e8
sort iterations in `group_by_iteration`
dilpath Dec 13, 2024
eaa4796
add `VIRTUAL_INITIAL_MODEL_HASH`
dilpath Dec 13, 2024
2d8017c
method to convert Models to dataframe; update plotting code
dilpath Dec 13, 2024
529c799
update vis example to use iterations
dilpath Dec 13, 2024
7224118
update vis notebook
dilpath Dec 13, 2024
49dc4a9
doc analysis methods briefly
dilpath Dec 13, 2024
3ec430b
typo
dilpath Dec 13, 2024
9432358
move models criterion getter to `Models`; add `Models.values()` for b…
dilpath Dec 13, 2024
53d7afe
update test
dilpath Dec 13, 2024
ee21f64
add Model.hashes
dilpath Dec 14, 2024
74398ae
test case 0009: add caveat
dilpath Dec 14, 2024
fb38d2d
fix notebooks
dilpath Dec 14, 2024
fe48416
update expected test case results
dilpath Dec 14, 2024
1fa6579
start sorting of constants
dilpath Dec 15, 2024
a7a7db6
refactor `Model` with mkstd
dilpath Dec 15, 2024
2e6828c
add some old petab parameter helpers to `Model`; add default_compare
dilpath Dec 15, 2024
f5d0589
remove constraint column (constraints aren't implemented yet)
dilpath Dec 16, 2024
6cad912
update test cases 1-8 expected models
dilpath Dec 16, 2024
c0e61cb
split `ModelBase` into `VirtualModelBase` to make virtual object; cas…
dilpath Dec 16, 2024
5efaf2f
update cli.py
dilpath Dec 16, 2024
bc0b086
update plot.py
dilpath Dec 16, 2024
7cf6a5a
update models.py
dilpath Dec 16, 2024
0df740a
update constants.py
dilpath Dec 16, 2024
6ece3fa
update ui.py
dilpath Dec 16, 2024
5b6ea51
refactor to remove `PetabMixin`
dilpath Dec 16, 2024
b03485d
update model_subspace.py; fix selector sets
dilpath Dec 16, 2024
bb965f8
predecessor_model now always set to virtual or real model; update can…
dilpath Dec 17, 2024
951f169
model subspace: require explicit parameter definitions; implement `ca…
dilpath Dec 17, 2024
8eef832
update famos candidate space
dilpath Dec 17, 2024
3106f16
fix standard type; support resolving relative paths in constructor
dilpath Dec 17, 2024
d69c0ba
fix 0009 expected yaml
dilpath Dec 17, 2024
469a602
test case 0009: update expected.yaml
dilpath Dec 17, 2024
e774b1c
check subclass first
dilpath Dec 17, 2024
bff07c3
dedent
dilpath Dec 17, 2024
7d57c35
Merge branch 'analyze' into mkstd
dilpath Dec 17, 2024
ec5b631
add schema; add to RTD
dilpath Dec 17, 2024
f36d70b
subheadings
dilpath Dec 17, 2024
e91123d
Update petab_select/model_subspace.py
dilpath Dec 18, 2024
09470ae
update test_analyze.py
dilpath Dec 17, 2024
aa2331e
update test_famos.py
dilpath Jan 1, 2025
241706c
review: add link
dilpath Jan 1, 2025
1735098
fix link
dilpath Jan 1, 2025
84d099d
update test_cli.py
dilpath Jan 1, 2025
6419dad
fix link
dilpath Jan 1, 2025
daf876b
fix test_model.py
dilpath Jan 1, 2025
1e01423
temp fix pypesto
dilpath Jan 1, 2025
1ef4dcd
fix link
dilpath Jan 1, 2025
678ae44
Merge branch 'develop' into mkstd
dilpath Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions doc/analysis.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Analysis
========

After using PEtab Select to perform model selection, you may want to operate on all "good" calibrated models.
The PEtab Select Python library provides some methods to help with this. Please request any missing methods.

See the Python API docs for the ``Models`` class, which provides some methods. In particular, ``Models.df`` can be used
to get a quick overview over all models, as a pandas dataframe.

Additionally, see the Python API docs for the ``petab_select.analysis`` module, which contains some methods to subset and group models,
or compute "weights" (e.g. Akaike weights).
70 changes: 49 additions & 21 deletions doc/examples/calibrated_models/calibrated_models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
AICc: 37.97523003111246
NLLH: 17.48761501555623
estimated_parameters:
sigma_x2: 4.462298385653177
sigma_x2: 4.462298422134608
iteration: 1
model_hash: M_0-000
model_id: M_0-000
model_subspace_id: M_0
Expand All @@ -17,11 +18,12 @@
petab_yaml: petab_problem.yaml
predecessor_model_hash: virtual_initial_model
- criteria:
AICc: -0.1754060811089051
NLLH: -4.0877030405544525
AICc: -0.17540608110890332
NLLH: -4.087703040554452
estimated_parameters:
k3: 0.0
sigma_x2: 0.12242920113658744
sigma_x2: 0.12242920113658338
iteration: 2
model_hash: M_1-000
model_id: M_1-000
model_subspace_id: M_1
Expand All @@ -36,11 +38,12 @@
petab_yaml: petab_problem.yaml
predecessor_model_hash: M_0-000
- criteria:
AICc: -0.27451405630430337
NLLH: -4.137257028152152
AICc: -0.27451438069575573
NLLH: -4.137257190347878
estimated_parameters:
k2: 0.10147827639089564
sigma_x2: 0.12142256779953603
k2: 0.10147824307890803
sigma_x2: 0.12142219599557078
iteration: 2
model_hash: M_2-000
model_id: M_2-000
model_subspace_id: M_2
Expand All @@ -55,11 +58,12 @@
petab_yaml: petab_problem.yaml
predecessor_model_hash: M_0-000
- criteria:
AICc: -0.7053270517931587
NLLH: -4.352663525896579
AICc: -0.7053270766271886
NLLH: -4.352663538313594
estimated_parameters:
k1: 0.20160888007873565
sigma_x2: 0.11713858557052499
k1: 0.20160925279667963
sigma_x2: 0.11714017664827497
iteration: 2
model_hash: M_3-000
model_id: M_3-000
model_subspace_id: M_3
Expand All @@ -74,12 +78,13 @@
petab_yaml: petab_problem.yaml
predecessor_model_hash: M_0-000
- criteria:
AICc: 9.294672948206841
NLLH: -4.352663525896579
AICc: 9.294672923372811
NLLH: -4.352663538313594
estimated_parameters:
k1: 0.20160888007873565
k1: 0.20160925279667963
k3: 0.0
sigma_x2: 0.11713858557052499
sigma_x2: 0.11714017664827497
iteration: 3
model_hash: M_5-000
model_id: M_5-000
model_subspace_id: M_5
Expand All @@ -94,12 +99,13 @@
petab_yaml: petab_problem.yaml
predecessor_model_hash: M_3-000
- criteria:
AICc: 7.852170288089528
NLLH: -5.073914855955236
AICc: 7.8521704398854
NLLH: -5.0739147800573
estimated_parameters:
k1: 0.20924739987621038
k2: 0.0859065470362628
sigma_x2: 0.1038731029818225
k1: 0.20924804320838675
k2: 0.0859052351446815
sigma_x2: 0.10386846319370771
iteration: 3
model_hash: M_6-000
model_id: M_6-000
model_subspace_id: M_6
Expand All @@ -113,3 +119,25 @@
k3: 0
petab_yaml: petab_problem.yaml
predecessor_model_hash: M_3-000
- criteria:
AICc: 35.94352968170024
NLLH: -6.028235159149878
estimated_parameters:
k1: 0.6228488917665873
k2: 0.020189424009226256
k3: 0.0010850434974038557
sigma_x2: 0.08859278245811462
iteration: 4
model_hash: M_7-000
model_id: M_7-000
model_subspace_id: M_7
model_subspace_indices:
- 0
- 0
- 0
parameters:
k1: estimate
k2: estimate
k3: estimate
petab_yaml: petab_problem.yaml
predecessor_model_hash: M_3-000
2 changes: 1 addition & 1 deletion doc/examples/example_cli_famos.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"petab_select/petab_select/candidate_space.py:1142: RuntimeWarning: Model `model_subspace_1-0001011010010010` has been previously excluded from the candidate space so is skipped here.\n",
"petab_select/petab_select/candidate_space.py:1160: RuntimeWarning: Model `model_subspace_1-0001011010010010` has been previously excluded from the candidate space so is skipped here.\n",
" return_value = self.inner_candidate_space.consider(model)\n"
]
},
Expand Down
1 change: 1 addition & 0 deletions doc/examples/model_selection/calibrated_M1_4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ criteria:
estimated_parameters:
k2: 0.15
k3: 0.0
iteration: 1
model_hash: M1_4-000
model_id: M1_4-000
model_subspace_id: M1_4
Expand Down
1 change: 1 addition & 0 deletions doc/examples/model_selection/calibrated_M1_7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ estimated_parameters:
k1: 0.25
k2: 0.1
k3: 0.0
iteration: 2
model_hash: M1_7-000
model_id: M1_7-000
model_subspace_id: M1_7
Expand Down
3 changes: 3 additions & 0 deletions doc/examples/model_selection/calibrated_models_1.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- criteria:
AIC: 180
estimated_parameters: {}
iteration: 1
model_hash: M1_0-000
model_id: M1_0-000
model_subspace_id: M1_0
Expand All @@ -17,6 +18,7 @@
- criteria:
AIC: 100
estimated_parameters: {}
iteration: 1
model_hash: M1_1-000
model_id: M1_1-000
model_subspace_id: M1_1
Expand All @@ -33,6 +35,7 @@
- criteria:
AIC: 50
estimated_parameters: {}
iteration: 1
model_hash: M1_2-000
model_id: M1_2-000
model_subspace_id: M1_2
Expand Down
Loading
Loading