NNSOM.utils.majority_class_cluster

NNSOM.utils.majority_class_cluster(cat_feature, clust)[source]

Return the majority class label for each cluster.

Parameters:
  • cat_feature (array-like of int, shape (N,)) – Integer-encoded categorical feature for all data points.

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

Returns:

majority_class – Most frequent class label in each cluster. None for empty clusters.

Return type:

np.ndarray, shape (numNeurons,)