(dist)
return np.sum(np.sum(- p * np.log2(pc), axis=0) *
                  np.sum(dist, axis=0) / np.sum(dist))
Entropy of class-distribution matrix
Entropy of class-distribution matrix
Entropy of class - distribution matrix
def _entropy(dist):
    """Entropy of class-distribution matrix"""
    p = dist / np.sum(dist, axis=0)
    pc = np.clip(p, 1e-15, 1)
    return np.sum(np.sum(- p * np.log2(pc), axis=0) *
                  np.sum(dist, axis=0) / np.sum(dist))
def _entropy ( dist ) : p = dist / np . sum ( dist , axis = 0 ) pc = np . clip ( p , 1e-15 , 1 ) return np . sum ( np . sum ( - p * np . log2 ( pc ) , axis = 0 ) * np . sum ( dist , axis = 0 ) / np . sum ( dist ) )