def brier_score_loss(y_true, y_prob, sample_weight=None, pos_label=None):
 y_true = column_or_1d(y_true)
 y_prob = column_or_1d(y_prob)
 assert_all_finite(y_true)
 assert_all_finite(y_prob)
 if (pos_label is None):
  pos_label = y_true.max()
 y_true = np.array((y_true == pos_label), int)
 y_true = _check_binary_probabilistic_predictions(y_true, y_prob)
 return np.average(((y_true - y_prob) ** 2), weights=sample_weight)

def brier_score_loss ( y_true , y_prob , sample_weight = None , pos_label = None ) : y_true = column_or_1d ( y_true ) y_prob = column_or_1d ( y_prob ) assert_all_finite ( y_true ) assert_all_finite ( y_prob ) if ( pos_label is None ) : pos_label = y_true . max ( ) y_true = np . array ( ( y_true == pos_label ) , int ) y_true = _check_binary_probabilistic_predictions ( y_true , y_prob ) return np . average ( ( ( y_true - y_prob ) ** 2 ) , weights = sample_weight )
compute the brier score .