@@ -182,7 +182,7 @@ def compute_grads(self, comp_covmat=False):
182
182
183
183
# ----------------------------------------------------------------------------------------------
184
184
185
- def compute_pearson (self , comp_p_mat = False , method = "jaccard" ):
185
+ def compute_pearson (self , comp_p_mat = False , similarity_method = "jaccard" ):
186
186
"""
187
187
Compute, for any couple (i,j) of points connected on the directed neighbourhood graph, an estimate of the
188
188
Pearson correlation coefficient between the directed deltaFij computed with the gradients in i and in j, namely
@@ -193,13 +193,13 @@ def compute_pearson(self, comp_p_mat=False, method="jaccard"):
193
193
194
194
Args:
195
195
comp_p_mat (bool): if True, also computes the pearson_mat attribute.
196
- method (str): method to compute the neighbourhood similarity index (see documentation for
197
- compute_neigh_similarity_index).
196
+ similarity_method (str): similarity_method to compute the neighbourhood similarity index (see documentation
197
+ for compute_neigh_similarity_index).
198
198
"""
199
199
200
200
# check or compute neigh_similarity_index
201
201
if self .neigh_similarity_index is None :
202
- self .compute_neigh_similarity_index (method = method )
202
+ self .compute_neigh_similarity_index (method = similarity_method )
203
203
# check or compute grads
204
204
if self .grads is None :
205
205
self .compute_grads ()
@@ -234,7 +234,7 @@ def compute_pearson(self, comp_p_mat=False, method="jaccard"):
234
234
self .pearson_mat = p_mat .todense ()
235
235
np .fill_diagonal (self .pearson_mat , 1.0 )
236
236
237
- def compute_deltaFs (self , pearson_method = "jaccard" , comp_p_mat = False ):
237
+ def compute_deltaFs (self , similarity_method = "jaccard" , comp_p_mat = False ):
238
238
"""Compute deviations deltaFij to standard kNN log-densities at point j as seen from point i using
239
239
a linear expansion with as slope the semisum of the average gradient of the log-density over
240
240
the neighbourhood of points i and j.
@@ -246,7 +246,7 @@ def compute_deltaFs(self, pearson_method="jaccard", comp_p_mat=False):
246
246
The log-density differences are stored Fij_array, their variances in Fij_array_var.
247
247
248
248
Args:
249
- pearson_method : see docs for compute_pearson function
249
+ similarity_method : see docs for neigh_graph.compute_neigh_similarity_index function
250
250
comp_p_mat: see docs for compute_pearson function
251
251
252
252
"""
@@ -270,7 +270,9 @@ def compute_deltaFs(self, pearson_method="jaccard", comp_p_mat=False):
270
270
271
271
# check or compute common_neighs
272
272
if self .pearson_mat is None :
273
- self .compute_pearson (method = pearson_method , comp_p_mat = comp_p_mat )
273
+ self .compute_pearson (
274
+ similarity_method = similarity_method , comp_p_mat = comp_p_mat
275
+ )
274
276
275
277
Fij_array = 0.5 * np .einsum ("ij, ij -> i" , g1 + g2 , self .neigh_vector_diffs )
276
278
vari = np .einsum (
@@ -296,18 +298,17 @@ def compute_deltaFs(self, pearson_method="jaccard", comp_p_mat=False):
296
298
297
299
# ----------------------------------------------------------------------------------------------
298
300
299
- def compute_deltaFs_inv_cross_covariance (self , pearson_method = "jaccard" ):
301
+ def compute_deltaFs_inv_cross_covariance (self , similarity_method = "jaccard" ):
300
302
"""Compute the appoximate inverse cross-covariance of the deltaFs cov[deltaFij,deltaFlm] using the LSDI
301
- approximation (see compute_density_BMTI_reg docs)
303
+ approximation (see compute_density_BMTI docs)
302
304
303
305
Args:
304
- pearson_method: see docs for compute_pearson function
305
-
306
+ similarity_method: see docs for neigh_graph.compute_neigh_similarity_index function
306
307
"""
307
308
308
309
# check for deltaFs
309
310
if self .pearson_mat is None :
310
- self .compute_pearson (method = pearson_method , comp_p_mat = True )
311
+ self .compute_pearson (similarity_method = similarity_method , comp_p_mat = True )
311
312
312
313
# check or compute deltaFs_grads_semisum
313
314
if self .Fij_var_array is None :
0 commit comments