subrela.clustering.get_subgroups function¶
-
subrela.clustering.get_subgroups(Z, group)[source]¶ List subgroups.
- Parameters
Z (pandas.DataFrame) – Data of clusters returned by
subrela.clustering.get_clustersfunction.group (int) – Index of a group cluster.
- Returns
subgroups (list[int]) – Indices of subgroup clusters.
Examples
>>> import numpy >>> X = numpy.array([[0, -5, -5, 6, 6], [0, -1, 1, -2, 2]]) >>> Z = get_clusters(X) >>> Z children distance leaves cluster 5 [1, 2] 2.000000 [1, 2] 6 [3, 4] 4.000000 [3, 4] 7 [0, 5] 5.099020 [0, 1, 2] 8 [6, 7] 6.324555 [3, 4, 0, 1, 2] >>> get_subgroups(Z, 7) [7, 0, 5, 1, 2]