NNSOM.utils.get_perc_cluster

NNSOM.utils.get_perc_cluster(cat_feature, target, clust)[source]

Return the percentage of a target class in each cluster.

Parameters:
  • cat_feature (array-like, shape (N,)) – Categorical feature values for all data points.

  • target (int or str) – The class label whose proportion is computed.

  • clust (list of array-like) – A list of cluster index arrays sorted by distance to the winning neuron.

Returns:

cluster_array – Percentage (0–100) of target class in each cluster. Zero for empty clusters.

Return type:

np.ndarray, shape (numNeurons,)