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

Retain updated Estimator in Corrector-generated MetaResults #633

Merged
merged 4 commits into from
Feb 11, 2022

Conversation

tsalo
Copy link
Member

@tsalo tsalo commented Feb 10, 2022

Closes None.

Changes proposed in this pull request:

  • Copy an updated version of the Estimator into the updated MetaResult object returned by Correctors, so that the updated MetaResult will have access to any new null distributions or other updated attributes that may be present in the Estimator after its been run through multiple comparisons correction.

To do:

  • Figure out why the uncorrected MetaResult's Estimator has Corrector-generated null distributions.

Here's what the changes mean:

from nimare.meta import MKDADensity
from nimare.correct import FWECorrector

# assuming we already have a Dataset as the variable "dset"
meta = MKDADensity()
results = meta.fit(dset)
corrector = FWECorrector(method="montecarlo", n_iters=10000)
cresults = corrector.transform(results)

# We shouldn't see the FWE null distributions in the original Estimator
print(meta.null_distributions_.keys())

# Nor in the original MetaResult's Estimator
print(results.estimator.null_distributions_.keys())

# But we should see it in the updated MetaResult's Estimator
print(cresults.estimator.null_distributions_.keys())

@tsalo tsalo added enhancement New feature or request ibma Issues/PRs pertaining to image-based meta-analysis cbma Issues/PRs pertaining to coordinate-based meta-analysis correct Issues related to the correct module labels Feb 10, 2022
@codecov
Copy link

codecov bot commented Feb 10, 2022

Codecov Report

Merging #633 (2a27255) into main (0c67c5e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #633   +/-   ##
=======================================
  Coverage   87.89%   87.89%           
=======================================
  Files          40       40           
  Lines        4319     4320    +1     
=======================================
+ Hits         3796     3797    +1     
  Misses        523      523           
Impacted Files Coverage Δ
nimare/correct.py 92.04% <100.00%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c67c5e...2a27255. Read the comment docs.

@tsalo tsalo merged commit c35ca9b into neurostuff:main Feb 11, 2022
@tsalo tsalo deleted the retain-estimator branch February 11, 2022 15:02
@tsalo tsalo added bug Issues noting problems and PRs fixing those problems. and removed enhancement New feature or request labels Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues noting problems and PRs fixing those problems. cbma Issues/PRs pertaining to coordinate-based meta-analysis correct Issues related to the correct module ibma Issues/PRs pertaining to image-based meta-analysis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant