NNSOM.utils.cal_class_cluster_intersect
- NNSOM.utils.cal_class_cluster_intersect(clust, *args)[source]
Calculate the intersection sizes of each class with each neuron cluster.
- Parameters:
- Returns:
cluster_sizes_matrix – Entry
[i, j]is the number of data points in classjthat are also in neuron clusteri.- Return type:
np.ndarray, shape (numNeurons, numClasses)
Examples
>>> clust = [[4, 5, 9], [1, 7], [2, 10, 11], [3, 6, 8]] >>> ind1 = np.array([1, 2, 3]) >>> ind2 = np.array([4, 5, 6]) >>> ind3 = np.array([7, 8, 9]) >>> ind4 = np.array([10, 11, 12]) >>> cal_class_cluster_intersect(clust, ind1, ind2, ind3, ind4) array([[0, 2, 1, 0], [1, 0, 1, 0], [1, 0, 0, 2], [1, 1, 1, 0]])