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

[FIX] fwe docstrings #868

Merged
merged 2 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion examples/02_meta-analyses/04_plot_estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
######################################################################################
# Note that, to measure significance appropriately with the montecarlo method,
# you need a lot more than 10 iterations.
# We recommend 10000 (the default value).
# We recommend 5000 (the default value).
mc_meta = ALE(null_method="montecarlo", n_iters=10, n_cores=1)
mc_results = mc_meta.fit(dset)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
###############################################################################
# Subtraction analysis
# -----------------------------------------------------------------------------
# Typically, one would use at least 10000 iterations for a subtraction analysis.
# Typically, one would use at least 5000 iterations for a subtraction analysis.
# However, we have reduced this to 100 iterations for this example.
# Similarly here we use a voxel-level z-threshold of 0.01, but in practice one would
# use a more stringent threshold (e.g., 1.65).
Expand Down
4 changes: 2 additions & 2 deletions nimare/annotate/gclda.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ def fit(self, n_iters=5000, loglikely_freq=10):

Parameters
----------
n_iters : :obj:`int`, optional
Number of iterations to run. Default is 10000.
n_iters : :obj:`int`, default=5000
Number of iterations to run. Default is 5000.
loglikely_freq : :obj:`int`, optional
The frequency with which log-likelihood is updated. Default value
is 1 (log-likelihood is updated every iteration).
Expand Down
4 changes: 2 additions & 2 deletions nimare/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def get_params(self, deep=True):

Parameters
----------
deep : :obj:`bool`, optional
deep : :obj:`bool`, default=True
If True, will return the parameters for this estimator and
contained subobjects that are estimators.

Expand Down Expand Up @@ -183,7 +183,7 @@ def load(cls, filename, compressed=True):
----------
filename : :obj:`str`
Name of file containing object.
compressed : :obj:`bool`, optional
compressed : :obj:`bool`, default=True
If True, the file is assumed to be compressed and gzip will be used
to load it. Otherwise, it will assume that the file is not
compressed. Default = True.
Expand Down
2 changes: 1 addition & 1 deletion nimare/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _get_parser():
dest="n_iters",
type=int,
help=("Number of iterations for permutation testing."),
default=10000,
default=5000,
)
macm_parser.add_argument(
"--v_thr",
Expand Down
8 changes: 4 additions & 4 deletions nimare/correct.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ class FWECorrector(Corrector):
using, use :meth:`inspect`.
voxel_thresh : :obj:`float`, optional
Only used if ``method='montecarlo'``. The uncorrected voxel-level threshold to use.
n_iters : :obj:`int`, optional
n_iters : :obj:`int`, default=5000
Number of iterations to use for Monte Carlo correction.
Default varies by Estimator.
For publication-quality results, 5000 or more iterations are recommended.
n_cores : :obj:`int`, optional
n_cores : :obj:`int`, default=1
Number of cores to use for Monte Carlo correction. Default is 1.
**kwargs
Keyword arguments to be used by the FWE correction implementation.
Expand Down Expand Up @@ -340,12 +340,12 @@ class FDRCorrector(Corrector):

Parameters
----------
method : :obj:`str`, optional
method : :obj:`str`, default='indep'
The FDR correction to use.
Either 'indep' (for independent or positively correlated values) or 'negcorr'
(for general or negatively correlated tests).
Default is 'indep'.
alpha : :obj:`float`, optional
alpha : :obj:`float`, default=0.05
The FDR correction rate to use. Default is 0.05.

Notes
Expand Down
2 changes: 1 addition & 1 deletion nimare/decode/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def fit(self, dataset, drop_invalid=True):
----------
dataset : :obj:`~nimare.dataset.Dataset`
Dataset object to analyze.
drop_invalid : :obj:`bool`, optional
drop_invalid : :obj:`bool`, default=True
Whether to automatically ignore any studies without the required data or not.
Default is True.

Expand Down
2 changes: 1 addition & 1 deletion nimare/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _collect_inputs(self, dataset, drop_invalid=True):
Parameters
----------
dataset : :obj:`~nimare.dataset.Dataset`
drop_invalid : :obj:`bool`, optional
drop_invalid : :obj:`bool`, default=True
Whether to automatically drop any studies in the Dataset without valid data or not.
Default is True.

Expand Down
20 changes: 10 additions & 10 deletions nimare/meta/cbma/ale.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ class ALE(CBMAEstimator):
This method is must slower, and is only slightly more accurate.
======================= =================================================================

n_iters : :obj:`int`, optional
n_iters : :obj:`int`, default=5000
Number of iterations to use to define the null distribution.
This is only used if ``null_method=="montecarlo"``.
Default is 10000.
Default is 5000.
memory : instance of :class:`joblib.Memory`, :obj:`str`, or :class:`pathlib.Path`
Used to cache the output of a function. By default, no caching is done.
If a :obj:`str` is given, it is the path to the caching directory.
memory_level : :obj:`int`, default=0
Rough estimator of the amount of memory used by caching.
Higher value means more memory for caching. Zero means no caching.
n_cores : :obj:`int`, optional
n_cores : :obj:`int`, default=1
Number of cores to use for parallelization.
This is only used if ``null_method=="montecarlo"``.
If <=0, defaults to using all available cores.
Expand Down Expand Up @@ -135,7 +135,7 @@ def __init__(
self,
kernel_transformer=ALEKernel,
null_method="approximate",
n_iters=None,
n_iters=5000,
memory=Memory(location=None, verbose=0),
memory_level=0,
n_cores=1,
Expand Down Expand Up @@ -348,15 +348,15 @@ class ALESubtraction(PairwiseCBMAEstimator):
kernel_transformer : :obj:`~nimare.meta.kernel.KernelTransformer`, optional
Kernel with which to convolve coordinates from dataset.
Default is ALEKernel.
n_iters : :obj:`int`, optional
Default is 10000.
n_iters : :obj:`int`, default=5000
Default is 5000.
memory : instance of :class:`joblib.Memory`, :obj:`str`, or :class:`pathlib.Path`
Used to cache the output of a function. By default, no caching is done.
If a :obj:`str` is given, it is the path to the caching directory.
memory_level : :obj:`int`, default=0
Rough estimator of the amount of memory used by caching.
Higher value means more memory for caching. Zero means no caching.
n_cores : :obj:`int`, optional
n_cores : :obj:`int`, default=1
Number of processes to use for meta-analysis. If -1, use all available cores.
Default is 1.

Expand Down Expand Up @@ -652,9 +652,9 @@ class SCALE(CBMAEstimator):
This parameter was previously incorrectly labeled as "optional" and indicated that
it supports tab-delimited files, which it does not (yet).

n_iters : int, optional
Number of iterations for statistical inference. Default: 10000
n_cores : int, optional
n_iters : int, default=5000
Number of iterations for statistical inference. Default: 5000
n_cores : int, default=1
Number of processes to use for meta-analysis. If -1, use all available cores.
Default: 1
kernel_transformer : :obj:`~nimare.meta.kernel.KernelTransformer`, optional
Expand Down
12 changes: 6 additions & 6 deletions nimare/meta/cbma/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def _p_to_summarystat(self, p, null_method=None):

return ss

def _compute_null_reduced_montecarlo(self, ma_maps, n_iters=10000):
def _compute_null_reduced_montecarlo(self, ma_maps, n_iters=5000):
"""Compute uncorrected null distribution using the reduced montecarlo method.

This method is much faster than the full montecarlo approach, but is still slower than the
Expand Down Expand Up @@ -615,15 +615,15 @@ def correct_fwe_montecarlo(
----------
result : :obj:`~nimare.results.MetaResult`
Result object from a CBMA meta-analysis.
voxel_thresh : :obj:`float`, optional
voxel_thresh : :obj:`float`, default=0.001
Cluster-defining p-value threshold. Default is 0.001.
n_iters : :obj:`int`, optional
n_iters : :obj:`int`, default=5000
Number of iterations to build the voxel-level, cluster-size, and cluster-mass FWE
null distributions. Default is 10000.
n_cores : :obj:`int`, optional
null distributions. Default is 5000.
n_cores : :obj:`int`, default=1
Number of cores to use for parallelization.
If <=0, defaults to using all available cores. Default is 1.
vfwe_only : :obj:`bool`, optional
vfwe_only : :obj:`bool`, default=False
If True, only calculate the voxel-level FWE-corrected maps. Voxel-level correction
can be performed very quickly if the Estimator's ``null_method`` was "montecarlo".
Default is False.
Expand Down
26 changes: 13 additions & 13 deletions nimare/meta/cbma/mkda.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ class MKDADensity(CBMAEstimator):
This method is must slower, and is only slightly more accurate.
======================= =================================================================

n_iters : int, optional
n_iters : int, default=5000
Number of iterations to use to define the null distribution.
This is only used if ``null_method=="montecarlo"``.
Default is 10000.
Default is 5000.
memory : instance of :class:`joblib.Memory`, :obj:`str`, or :class:`pathlib.Path`
Used to cache the output of a function. By default, no caching is done.
If a :obj:`str` is given, it is the path to the caching directory.
Expand Down Expand Up @@ -135,7 +135,7 @@ def __init__(
self,
kernel_transformer=MKDAKernel,
null_method="approximate",
n_iters=None,
n_iters=5000,
memory=Memory(location=None, verbose=0),
memory_level=0,
n_cores=1,
Expand All @@ -156,7 +156,7 @@ def __init__(
**kwargs,
)
self.null_method = null_method
self.n_iters = None if null_method == "approximate" else n_iters or 10000
self.n_iters = None if null_method == "approximate" else n_iters or 5000
self.n_cores = _check_ncores(n_cores)
self.dataset = None

Expand Down Expand Up @@ -322,7 +322,7 @@ class MKDAChi2(PairwiseCBMAEstimator):
kernel_transformer : :obj:`~nimare.meta.kernel.KernelTransformer`, optional
Kernel with which to convolve coordinates from dataset. Default is
:class:`~nimare.meta.kernel.MKDAKernel`.
prior : float, optional
prior : float, default=0.5
Uniform prior probability of each feature being active in a map in
the absence of evidence from the map. Default: 0.5
memory : instance of :class:`joblib.Memory`, :obj:`str`, or :class:`pathlib.Path`
Expand Down Expand Up @@ -732,12 +732,12 @@ def correct_fwe_montecarlo(self, result, voxel_thresh=0.001, n_iters=1000, n_cor
----------
result : :obj:`~nimare.results.MetaResult`
Result object from a KDA meta-analysis.
voxel_thresh : :obj:`float`, optional
voxel_thresh : :obj:`float`, default=0.001
Voxel-level threshold. Default is 0.001.
n_iters : :obj:`int`, optional
n_iters : :obj:`int`, default=1000
Number of iterations to build the vFWE null distribution.
Default is 5000.
n_cores : :obj:`int`, optional
Default is 1000.
n_cores : :obj:`int`, default=1
Number of cores to use for parallelization.
If <=0, defaults to using all available cores. Default is 1.

Expand Down Expand Up @@ -1057,17 +1057,17 @@ class KDA(CBMAEstimator):
This method is must slower, and is only slightly more accurate.
======================= =================================================================

n_iters : int, optional
n_iters : int, default=5000
Number of iterations to use to define the null distribution.
This is only used if ``null_method=="montecarlo"``.
Default is 10000.
Default is 5000.
memory : instance of :class:`joblib.Memory`, :obj:`str`, or :class:`pathlib.Path`
Used to cache the output of a function. By default, no caching is done.
If a :obj:`str` is given, it is the path to the caching directory.
memory_level : :obj:`int`, default=0
Rough estimator of the amount of memory used by caching.
Higher value means more memory for caching. Zero means no caching.
n_cores : :obj:`int`, optional
n_cores : :obj:`int`, default=1
Number of cores to use for parallelization.
This is only used if ``null_method=="montecarlo"``.
If <=0, defaults to using all available cores.
Expand Down Expand Up @@ -1139,7 +1139,7 @@ def __init__(
self,
kernel_transformer=KDAKernel,
null_method="approximate",
n_iters=None,
n_iters=5000,
memory=Memory(location=None, verbose=0),
memory_level=0,
n_cores=1,
Expand Down
8 changes: 4 additions & 4 deletions nimare/meta/ibma.py
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ def _fit(self, dataset):

return maps, {}, description

def correct_fwe_montecarlo(self, result, n_iters=1000, n_cores=1):
def correct_fwe_montecarlo(self, result, n_iters=5000, n_cores=1):
"""Perform FWE correction using the max-value permutation method.

.. versionchanged:: 0.0.8
Expand All @@ -1336,10 +1336,10 @@ def correct_fwe_montecarlo(self, result, n_iters=1000, n_cores=1):
----------
result : :obj:`~nimare.results.MetaResult`
Result object from an ALE meta-analysis.
n_iters : :obj:`int`, optional
n_iters : :obj:`int`, default=5000
The number of iterations to run in estimating the null distribution.
Default is 10000.
n_cores : :obj:`int`, optional
Default is 5000.
n_cores : :obj:`int`, default=1
Number of cores to use for parallelization.
If <=0, defaults to using all available cores. Default is 1.

Expand Down
8 changes: 4 additions & 4 deletions nimare/meta/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,9 @@ class KDAKernel(KernelTransformer):

Parameters
----------
r : :obj:`int`, optional
r : :obj:`int`, default=10
Sphere radius, in mm.
value : :obj:`int`, optional
value : :obj:`int`, default=1
Value for sphere.
memory : instance of :class:`joblib.Memory`, :obj:`str`, or :class:`pathlib.Path`
Used to cache the output of a function. By default, no caching is done.
Expand Down Expand Up @@ -468,9 +468,9 @@ class MKDAKernel(KDAKernel):

Parameters
----------
r : :obj:`int`, optional
r : :obj:`int`, default=10
Sphere radius, in mm.
value : :obj:`int`, optional
value : :obj:`int`, default=1
Value for sphere.
memory : instance of :class:`joblib.Memory`, :obj:`str`, or :class:`pathlib.Path`
Used to cache the output of a function. By default, no caching is done.
Expand Down
6 changes: 3 additions & 3 deletions nimare/workflows/cbma.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class CBMAWorkflow(Workflow):
Parameters
----------
estimator : :class:`~nimare.meta.cbma.base.CBMAEstimator`, :obj:`str` {'ale', 'scale', \
'mkdadensity', 'kda'}, or optional
'mkdadensity', 'kda'}, optional
Meta-analysis estimator. Default is :class:`~nimare.meta.cbma.ale.ALE`.
corrector : :class:`~nimare.correct.Corrector`, :obj:`str` {'montecarlo', 'fdr', \
'bonferroni'} or optional
'bonferroni'}, optional
Meta-analysis corrector. Default is :class:`~nimare.correct.FWECorrector`.
diagnostics : :obj:`list` of :class:`~nimare.diagnostics.Diagnostics`, \
:class:`~nimare.diagnostics.Diagnostics`, :obj:`str` {'jackknife', 'focuscounter'}, \
or optional
optional
List of meta-analysis diagnostic classes. A single diagnostic class can also be passed.
Default is :class:`~nimare.diagnostics.FocusCounter`.
voxel_thresh : :obj:`float` or None, optional
Expand Down
2 changes: 1 addition & 1 deletion nimare/workflows/macm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def macm_workflow(
mask_file,
output_dir=None,
prefix=None,
n_iters=10000,
n_iters=5000,
v_thr=0.001,
n_cores=1,
):
Expand Down
Loading