code: def brier(y, yhat, positive=True):
      """Returns the Brier score between y and yhat.
  
      :param y: true function values
      :param yhat: predicted function values
      :returns:
          .. math:: \\frac{1}{n} \sum_{i=1}^n \\big[(\hat{y}-y)^2\\big]
  
      yhat must be a vector of probabilities, e.g. elements in [0, 1]
  
      Lower is better.
  
      .. note:: This loss function should only be used for probabilistic models.
  
      """
      y = map(lambda x: x == positive, y)
      return sum(
          [(yp - float(yt)) ** 2 for yt, yp in zip(y, yhat)]
      ) / len(y)
  
imports: import math
  import operator
label_desc: Use image node_id 12 for calling a global function with example usage: brier(y, yhat, positive) and returns: unknown