(cls, CS)
return E, ES1, ES2
Return the class information entropy induced by partitioning
        the `CS` distribution at all N-1 candidate cut points.

        Parameters
        ----------
        CS : (N, K) array of class distributions.
Return the class information entropy induced by partitioning
        the `CS` distribution at all N-1 candidate cut points.
Return the class information entropy induced by partitioning the CS distribution at all N - 1 candidate cut points .
def _entropy_cuts_sorted(cls, CS):
        """
        Return the class information entropy induced by partitioning
        the `CS` distribution at all N-1 candidate cut points.

        Parameters
        ----------
        CS : (N, K) array of class distributions.
        """
        CS = np.asarray(CS)
        # |--|-------|--------|
        #  S1    ^       S2
        # S1 contains all points which are <= to cut point
        # Cumulative distributions for S1 and S2 (left right set)
        # i.e. a cut at index i separates the CS into S1Dist[i] and S2Dist[i]
        S1Dist = np.cumsum(CS, axis=0)[:-1]
        S2Dist = np.cumsum(CS[::-1], axis=0)[-2::-1]

        # Entropy of S1[i] and S2[i] sets
        ES1 = cls._entropy2(S1Dist)
        ES2 = cls._entropy2(S2Dist)

        # Number of cases in S1[i] and S2[i] sets
        S1_count = np.sum(S1Dist, axis=1)
        S2_count = np.sum(S2Dist, axis=1)

        # Number of all cases
        S_count = np.sum(CS)

        ES1w = ES1 * S1_count / S_count
        ES2w = ES2 * S2_count / S_count

        # E(A, T; S) Class information entropy of the partition S
        E = ES1w + ES2w

        return E, ES1, ES2
def _entropy_cuts_sorted ( cls , CS ) : CS = np . asarray ( CS ) # |--|-------|--------| #  S1    ^       S2 # S1 contains all points which are <= to cut point # Cumulative distributions for S1 and S2 (left right set) # i.e. a cut at index i separates the CS into S1Dist[i] and S2Dist[i] S1Dist = np . cumsum ( CS , axis = 0 ) [ : - 1 ] S2Dist = np . cumsum ( CS [ : : - 1 ] , axis = 0 ) [ - 2 : : - 1 ] # Entropy of S1[i] and S2[i] sets ES1 = cls . _entropy2 ( S1Dist ) ES2 = cls . _entropy2 ( S2Dist ) # Number of cases in S1[i] and S2[i] sets S1_count = np . sum ( S1Dist , axis = 1 ) S2_count = np . sum ( S2Dist , axis = 1 ) # Number of all cases S_count = np . sum ( CS ) ES1w = ES1 * S1_count / S_count ES2w = ES2 * S2_count / S_count # E(A, T; S) Class information entropy of the partition S E = ES1w + ES2w return E , ES1 , ES2