def _check_binary_probabilistic_predictions(y_true, y_prob):
 check_consistent_length(y_true, y_prob)
 labels = np.unique(y_true)
 if (len(labels) > 2):
  raise ValueError(('Only binary classification is supported. Provided labels %s.' % labels))
 if (y_prob.max() > 1):
  raise ValueError('y_prob contains values greater than 1.')
 if (y_prob.min() < 0):
  raise ValueError('y_prob contains values less than 0.')
 return label_binarize(y_true, labels)[:, 0]

def _check_binary_probabilistic_predictions ( y_true , y_prob ) : check_consistent_length ( y_true , y_prob ) labels = np . unique ( y_true ) if ( len ( labels ) > 2 ) : raise ValueError ( ( 'Only binary classification is supported. Provided labels %s.' % labels ) ) if ( y_prob . max ( ) > 1 ) : raise ValueError ( 'y_prob contains values greater than 1.' ) if ( y_prob . min ( ) < 0 ) : raise ValueError ( 'y_prob contains values less than 0.' ) return label_binarize ( y_true , labels ) [ : , 0 ]
check that y_true is binary and y_prob contains valid probabilities .