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

Add option for hierarchical models #1241

Merged
merged 11 commits into from
Dec 11, 2023
Merged

Conversation

vwiela
Copy link
Contributor

@vwiela vwiela commented Dec 7, 2023

Add option for hierarchical models in model_selection.

Add option for hierarchical models in model selection
Fix typo
@vwiela vwiela requested a review from dilpath as a code owner December 7, 2023 11:38
import pandas
@codecov-commenter
Copy link

codecov-commenter commented Dec 7, 2023

Codecov Report

Attention: 387 lines in your changes are missing coverage. Please review.

Comparison is base (160c2a8) 88.16% compared to head (3ca173e) 82.55%.
Report is 470 commits behind head on develop.

Files Patch % Lines
pypesto/ensemble/ensemble.py 69.77% 68 Missing ⚠️
...ypesto/hierarchical/spline_approximation/solver.py 82.62% 53 Missing ⚠️
pypesto/ensemble/util.py 65.13% 38 Missing ⚠️
pypesto/hierarchical/optimal_scaling/solver.py 93.53% 26 Missing ⚠️
pypesto/history/base.py 88.57% 24 Missing ⚠️
pypesto/hierarchical/petab.py 84.56% 23 Missing ⚠️
pypesto/engine/mpi_pool.py 0.00% 22 Missing ⚠️
pypesto/hierarchical/inner_calculator_collector.py 88.51% 17 Missing ⚠️
...pesto/hierarchical/spline_approximation/problem.py 89.18% 16 Missing ⚠️
pypesto/hierarchical/problem.py 89.23% 14 Missing ⚠️
... and 16 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1241      +/-   ##
===========================================
- Coverage    88.16%   82.55%   -5.62%     
===========================================
  Files           79      148      +69     
  Lines         5257    11955    +6698     
===========================================
+ Hits          4635     9869    +5234     
- Misses         622     2086    +1464     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@dilpath dilpath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks! Let's merge this after you see that it works in your case.

pypesto/select/misc.py Outdated Show resolved Hide resolved
pypesto/select/misc.py Outdated Show resolved Hide resolved
pypesto/select/misc.py Outdated Show resolved Hide resolved
pypesto/select/misc.py Outdated Show resolved Hide resolved
pypesto/select/misc.py Outdated Show resolved Hide resolved
pypesto/select/misc.py Outdated Show resolved Hide resolved
vwiela and others added 8 commits December 7, 2023 13:48
Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
Comment on lines +41 to +42
hierarchical:
Whether the problem involves hierarchical optimization.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about directly forwarding any **kwargs to PetabImporter()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be done as well.
I personally found it more transparent in this way, instead of hiding it in **kwargs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These methods (model_to_pypesto_problem and model_to_hierarchical_pypesto_problem) are used as an argument [1].

A separate method was provided so that the user doesn't need to setup with partial like

from functools import partial
model_to_pypesto_problem_method = partial(model_to_pypesto_problem, hierarchical=True)
pypesto_select_problem.select_to_completion(..., model_to_pypesto_problem_method=model_to_pypesto_problem_method)

I think forwarding **kwargs is a good idea, but they will need to be forwarded to two calls: correct_x_guesses and PetabImporter

[1]

model_to_pypesto_problem_method: Callable[[Any], Problem] = None,

@vwiela vwiela merged commit 1224d29 into develop Dec 11, 2023
18 checks passed
@vwiela vwiela deleted the fix_hierarchical_model_selection branch December 11, 2023 08:02
This was referenced Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants