Skip to content

Commit

Permalink
Merge pull request #406 from cosanlab/0.4.6
Browse files Browse the repository at this point in the history
WIP 0.4.6 Release
  • Loading branch information
ejolly committed Aug 15, 2022
2 parents a1ac36e + 8eca94a commit d9f65ba
Show file tree
Hide file tree
Showing 12 changed files with 253 additions and 215 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
@@ -1,5 +1,7 @@
{
"editor.formatOnSave": true,
"[python]": {
"editor.formatOnSave": true
},
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
Expand Down
26 changes: 16 additions & 10 deletions nltools/data/adjacency.py
Expand Up @@ -692,13 +692,17 @@ def similarity(
ignore_diagonal=False,
**kwargs,
):
"""Calculate similarity between two Adjacency matrices.
Default is to use spearman correlation and permutation test.
"""
Calculate similarity between two Adjacency matrices. Default is to use spearman
correlation and permutation test.
Args:
data: Adjacency data, or 1-d array same size as self.data
data (Adjacency or array): Adjacency data, or 1-d array same size as self.data
perm_type: (str) '1d','2d', or None
metric: (str) 'spearman','pearson','kendall'
ignore_diagonal: (bool) only applies to 'directed' Adjacency types using perm_type=None or perm_type='1d'
ignore_diagonal: (bool) only applies to 'directed' Adjacency types using
perm_type=None or perm_type='1d'
"""
data1 = self.copy()
if not isinstance(data, Adjacency):
Expand Down Expand Up @@ -1015,19 +1019,21 @@ def bootstrap(
):
"""Bootstrap an Adjacency method.
Example Useage:
b = dat.bootstrap('mean', n_samples=5000)
b = dat.bootstrap('predict', n_samples=5000, algorithm='ridge')
b = dat.bootstrap('predict', n_samples=5000, save_weights=True)
Args:
function: (str) method to apply to data for each bootstrap
n_samples: (int) number of samples to bootstrap with replacement
save_weights: (bool) Save each bootstrap iteration
(useful for aggregating many bootstraps on a cluster)
n_jobs: (int) The number of CPUs to use to do the computation.
-1 means all CPUs.Returns:
output: summarized studentized bootstrap output
Returns:
summarized studentized bootstrap output
Examples:
>>> b = dat.bootstrap('mean', n_samples=5000)
>>> b = dat.bootstrap('predict', n_samples=5000, algorithm='ridge')
>>> b = dat.bootstrap('predict', n_samples=5000, save_weights=True)
"""

Expand Down

0 comments on commit d9f65ba

Please sign in to comment.