Skip to content

Commit d9f65ba

Browse files
authored
Merge pull request #406 from cosanlab/0.4.6
WIP 0.4.6 Release
2 parents a1ac36e + 8eca94a commit d9f65ba

File tree

12 files changed

+253
-215
lines changed

12 files changed

+253
-215
lines changed

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"editor.formatOnSave": true,
2+
"[python]": {
3+
"editor.formatOnSave": true
4+
},
35
"python.testing.pytestEnabled": true,
46
"python.testing.unittestEnabled": false,
57
"python.testing.nosetestsEnabled": false,

nltools/data/adjacency.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -692,13 +692,17 @@ def similarity(
692692
ignore_diagonal=False,
693693
**kwargs,
694694
):
695-
"""Calculate similarity between two Adjacency matrices.
696-
Default is to use spearman correlation and permutation test.
695+
"""
696+
Calculate similarity between two Adjacency matrices. Default is to use spearman
697+
correlation and permutation test.
698+
697699
Args:
698-
data: Adjacency data, or 1-d array same size as self.data
700+
data (Adjacency or array): Adjacency data, or 1-d array same size as self.data
699701
perm_type: (str) '1d','2d', or None
700702
metric: (str) 'spearman','pearson','kendall'
701-
ignore_diagonal: (bool) only applies to 'directed' Adjacency types using perm_type=None or perm_type='1d'
703+
ignore_diagonal: (bool) only applies to 'directed' Adjacency types using
704+
perm_type=None or perm_type='1d'
705+
702706
"""
703707
data1 = self.copy()
704708
if not isinstance(data, Adjacency):
@@ -1015,19 +1019,21 @@ def bootstrap(
10151019
):
10161020
"""Bootstrap an Adjacency method.
10171021
1018-
Example Useage:
1019-
b = dat.bootstrap('mean', n_samples=5000)
1020-
b = dat.bootstrap('predict', n_samples=5000, algorithm='ridge')
1021-
b = dat.bootstrap('predict', n_samples=5000, save_weights=True)
1022-
10231022
Args:
10241023
function: (str) method to apply to data for each bootstrap
10251024
n_samples: (int) number of samples to bootstrap with replacement
10261025
save_weights: (bool) Save each bootstrap iteration
10271026
(useful for aggregating many bootstraps on a cluster)
10281027
n_jobs: (int) The number of CPUs to use to do the computation.
10291028
-1 means all CPUs.Returns:
1030-
output: summarized studentized bootstrap output
1029+
1030+
Returns:
1031+
summarized studentized bootstrap output
1032+
1033+
Examples:
1034+
>>> b = dat.bootstrap('mean', n_samples=5000)
1035+
>>> b = dat.bootstrap('predict', n_samples=5000, algorithm='ridge')
1036+
>>> b = dat.bootstrap('predict', n_samples=5000, save_weights=True)
10311037
10321038
"""
10331039

0 commit comments

Comments
 (0)