code: def logloss(y, yhat):
      """Returns the log loss between labels and predictions.
  
      :param y: true function values
      :param yhat: predicted function values
      :returns:
          .. math:: -\\frac{1}{n}\sum_{i=1}^n\\big[y \\times \log \hat{y}+(1-y) \\times \log (1-\hat{y})\\big]
  
      y must be a binary vector, e.g. elements in {True, False}
      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.
  
      """
      loss = sum(
          [
              math.log(pred)
              for _, pred in filter(lambda i: i[0], zip(y, yhat))
          ]
      )
      loss += sum(
          [
              math.log(1 - pred)
              for _, pred in filter(lambda i: not i[0], zip(y, yhat))
          ]
      )
      return -float(loss) / len(y)
  
imports: import math
  import operator
label_desc: Use image node_id 11 for calling a global function with example usage: logloss(y, yhat) and returns: unknown