File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -246,10 +246,10 @@ cdef dict _compute_stability(
246
246
cnp.intp_t parent, cluster_size, result_index, idx
247
247
cnp.float64_t lambda_val
248
248
CONDENSED_t condensed_node
249
- cnp.float64_t[:, :] result_pre_dict
250
249
cnp.intp_t largest_child = condensed_tree[' child' ].max()
251
250
cnp.intp_t smallest_cluster = np.min(parents)
252
251
cnp.intp_t num_clusters = np.max(parents) - smallest_cluster + 1
252
+ dict stability_dict = {}
253
253
254
254
largest_child = max (largest_child, smallest_cluster)
255
255
births = np.full(largest_child + 1 , np.nan, dtype = np.float64)
@@ -270,14 +270,10 @@ cdef dict _compute_stability(
270
270
result_index = parent - smallest_cluster
271
271
result[result_index] += (lambda_val - births[parent]) * cluster_size
272
272
273
- result_pre_dict = np.vstack(
274
- (
275
- np.arange(smallest_cluster, np.max(parents) + 1 ),
276
- result
277
- )
278
- ).T
273
+ for idx in range (num_clusters):
274
+ stability_dict[idx + smallest_cluster] = result[idx]
279
275
280
- return dict (result_pre_dict)
276
+ return stability_dict
281
277
282
278
283
279
cdef list bfs_from_cluster_tree(
You can’t perform that action at this time.
0 commit comments