class_docstr: A loss appropriate for binary classification tasks.
class_docstr_tok: ["A","loss","appropriate","for","binary","classification","tasks","."]
code: def mean_func(self, y_pred):
      if isinstance(y_pred, np.ndarray):
          return 1.0 / (1.0 + np.exp(-y_pred))
      return utils.math.sigmoid(y_pred)
  
imports: from __future__ import annotations
  import math
  import numpy
  from scipy import special
  from river import base, utils
  from river.optim.base import Loss
label_desc: Use image node_id 1 for calling the BinaryLoss obj's underlying member method code with example usage: obj.mean_func(y_pred) and returns: utils, unknown