-
Notifications
You must be signed in to change notification settings - Fork 18
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 weighting function for several scenarios #567
Add weighting function for several scenarios #567
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #567 +/- ##
==========================================
+ Coverage 77.93% 78.10% +0.17%
==========================================
Files 49 49
Lines 2986 3010 +24
==========================================
+ Hits 2327 2351 +24
Misses 659 659
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh - I just realized that the text and code of Lea's weight generation does not align:
mesmer/mesmer/calibrate_mesmer/train_utils.py
Lines 14 to 15 in 456776d
derive scenario weights such that each has equal weight, i.e., 1 / number of samples | |
(= nr_runs * nr_ts) |
weights.append(np.full(nr_samples_scen, 1 / nr_runs)) |
Let me check if I introduced this error or if this was always the case. -> See #569
Given your tests: should exclude
be all dims that are not in ens_dim
(i.e. remove it from the input params)? I am a bit afraid that the user will forget to add the correct exclude
. Does it actually work if you don't exclude all the remaining dims?
Hm given #569 we could also extend the weighting function to have several options, something like "by_ens", "by_ens_ts" or even pass a function to do it... I have to think about it some more. |
Co-authored-by: Mathias Hauser <[email protected]>
Co-authored-by: Mathias Hauser <[email protected]>
I would probably go via |
No, in practice all dims except for |
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v4...v5) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
) * implement datatree and dataset in linear regression * tests * extend tests to root dt --------- Co-authored-by: Mathias Hauser <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks. map_over_subtree
skips empty nodes, right?
Co-authored-by: Mathias Hauser <[email protected]>
Co-authored-by: Mathias Hauser <[email protected]>
Yes. |
* implement weighting for several scnearios and members * implement tests * work around datatree.testing * extend tests to root dt * docs --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Mathias Hauser <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Add a function go generate weights such that each scenario contributes equally to some fitting routine. This means that a member of a scenario with a lot of members weighs less than a member of a scenario with few members.
CHANGELOG.rst