def _predict_binary(estimator, X):
 if is_regressor(estimator):
  return estimator.predict(X)
 try:
  score = np.ravel(estimator.decision_function(X))
 except (AttributeError, NotImplementedError):
  score = estimator.predict_proba(X)[:, 1]
 return score

def _predict_binary ( estimator , X ) : if is_regressor ( estimator ) : return estimator . predict ( X ) try : score = np . ravel ( estimator . decision_function ( X ) ) except ( AttributeError , NotImplementedError ) : score = estimator . predict_proba ( X ) [ : , 1 ] return score
make predictions using a single binary estimator .