@@ -3185,6 +3185,7 @@ def plot_dendrogram(
3185
3185
)
3186
3186
else :
3187
3187
clustering_inds = hr .fcluster (clustering , k , criterion = "maxclust" )
3188
+
3188
3189
L , M = hr .leaders (clustering , np .array (clustering_inds , dtype = np .int32 ))
3189
3190
root , nodes = hr .to_tree (clustering , rd = True )
3190
3191
nodes = np .array ([i .dist for i in nodes ])
@@ -3450,6 +3451,8 @@ def plot_network(
3450
3451
k , clustering_inds = af .std_silhouette_score (dist , clustering , max_k )
3451
3452
else :
3452
3453
raise ValueError ("The only opt_k_method available are twodiff and stdsil" )
3454
+ else :
3455
+ clustering_inds = hr .fcluster (clustering , k , criterion = "maxclust" )
3453
3456
3454
3457
clusters = {i : [] for i in np .unique (clustering_inds )}
3455
3458
for i , v in enumerate (clustering_inds ):
@@ -4035,6 +4038,8 @@ def plot_clusters_network(
4035
4038
k , clustering_inds = af .std_silhouette_score (dist , clustering , max_k )
4036
4039
else :
4037
4040
raise ValueError ("The only opt_k_method available are twodiff and stdsil" )
4041
+ else :
4042
+ clustering_inds = hr .fcluster (clustering , k , criterion = "maxclust" )
4038
4043
4039
4044
clusters = {i : [] for i in np .unique (clustering_inds )}
4040
4045
for i , v in enumerate (clustering_inds ):
@@ -4329,6 +4334,8 @@ def plot_clusters_network_allocation(
4329
4334
k , clustering_inds = af .std_silhouette_score (dist , clustering , max_k )
4330
4335
else :
4331
4336
raise ValueError ("The only opt_k_method available are twodiff and stdsil" )
4337
+ else :
4338
+ clustering_inds = hr .fcluster (clustering , k , criterion = "maxclust" )
4332
4339
4333
4340
clusters = {i : [] for i in np .unique (clustering_inds )}
4334
4341
for i , v in enumerate (clustering_inds ):
0 commit comments