def _samme_proba(estimator, n_classes, X):
 proba = estimator.predict_proba(X)
 proba[(proba < np.finfo(proba.dtype).eps)] = np.finfo(proba.dtype).eps
 log_proba = np.log(proba)
 return ((n_classes - 1) * (log_proba - ((1.0 / n_classes) * log_proba.sum(axis=1)[:, np.newaxis])))

def _samme_proba ( estimator , n_classes , X ) : proba = estimator . predict_proba ( X ) proba [ ( proba < np . finfo ( proba . dtype ) . eps ) ] = np . finfo ( proba . dtype ) . eps log_proba = np . log ( proba ) return ( ( n_classes - 1 ) * ( log_proba - ( ( 1.0 / n_classes ) * log_proba . sum ( axis = 1 ) [ : , np . newaxis ] ) ) )
calculate algorithm 4 .