diff --git a/examples/02_meta-analyses/04_plot_estimators.py b/examples/02_meta-analyses/04_plot_estimators.py index c1ed2d380..37e7e1eb1 100644 --- a/examples/02_meta-analyses/04_plot_estimators.py +++ b/examples/02_meta-analyses/04_plot_estimators.py @@ -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) diff --git a/examples/02_meta-analyses/08_plot_cbma_subtraction_conjunction.py b/examples/02_meta-analyses/08_plot_cbma_subtraction_conjunction.py index 9bbc9bf2e..dd6bc02c3 100644 --- a/examples/02_meta-analyses/08_plot_cbma_subtraction_conjunction.py +++ b/examples/02_meta-analyses/08_plot_cbma_subtraction_conjunction.py @@ -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). diff --git a/nimare/annotate/gclda.py b/nimare/annotate/gclda.py index 51b1cec6e..2a99be855 100755 --- a/nimare/annotate/gclda.py +++ b/nimare/annotate/gclda.py @@ -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). diff --git a/nimare/base.py b/nimare/base.py index b63e9c138..ed6594f73 100644 --- a/nimare/base.py +++ b/nimare/base.py @@ -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. @@ -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. diff --git a/nimare/cli.py b/nimare/cli.py index 45a7a9790..89ad3bdae 100644 --- a/nimare/cli.py +++ b/nimare/cli.py @@ -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", diff --git a/nimare/correct.py b/nimare/correct.py index 3c11e3f03..9d379bb6a 100644 --- a/nimare/correct.py +++ b/nimare/correct.py @@ -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. @@ -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 diff --git a/nimare/decode/base.py b/nimare/decode/base.py index 2aba8e2a7..ae70fa699 100644 --- a/nimare/decode/base.py +++ b/nimare/decode/base.py @@ -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. diff --git a/nimare/estimator.py b/nimare/estimator.py index 25ee092dc..6cfba9d4c 100644 --- a/nimare/estimator.py +++ b/nimare/estimator.py @@ -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. diff --git a/nimare/meta/cbma/ale.py b/nimare/meta/cbma/ale.py index 288cf9886..cf794839a 100755 --- a/nimare/meta/cbma/ale.py +++ b/nimare/meta/cbma/ale.py @@ -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. @@ -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, @@ -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. @@ -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 diff --git a/nimare/meta/cbma/base.py b/nimare/meta/cbma/base.py index d9d196664..0899dd3e5 100644 --- a/nimare/meta/cbma/base.py +++ b/nimare/meta/cbma/base.py @@ -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 @@ -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. diff --git a/nimare/meta/cbma/mkda.py b/nimare/meta/cbma/mkda.py index 459600843..2faf529bb 100644 --- a/nimare/meta/cbma/mkda.py +++ b/nimare/meta/cbma/mkda.py @@ -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. @@ -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, @@ -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 @@ -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` @@ -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. @@ -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. @@ -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, diff --git a/nimare/meta/ibma.py b/nimare/meta/ibma.py index bab35da1b..ba1438ffa 100755 --- a/nimare/meta/ibma.py +++ b/nimare/meta/ibma.py @@ -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 @@ -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. diff --git a/nimare/meta/kernel.py b/nimare/meta/kernel.py index 9ea1bf31b..d6919d570 100644 --- a/nimare/meta/kernel.py +++ b/nimare/meta/kernel.py @@ -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. @@ -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. diff --git a/nimare/workflows/cbma.py b/nimare/workflows/cbma.py index dffef51fd..8e3fe3bbc 100644 --- a/nimare/workflows/cbma.py +++ b/nimare/workflows/cbma.py @@ -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 diff --git a/nimare/workflows/macm.py b/nimare/workflows/macm.py index 9443033c8..3fe0b8676 100644 --- a/nimare/workflows/macm.py +++ b/nimare/workflows/macm.py @@ -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, ):