code: def _log_loss(y, y_pred, w):
      """Calculate the log loss."""
      eps = 1e-15
      inv_y_pred = np.clip(1 - y_pred, eps, 1 - eps)
      y_pred = np.clip(y_pred, eps, 1 - eps)
      score = y * np.log(y_pred) + (1 - y) * np.log(inv_y_pred)
      return np.average(-score, weights=w)
  
file_path: gplearn/gplearn/fitness.py
imports: import numbers
  import numpy
  from joblib import wrap_non_picklable_objects
  from scipy.stats import rankdata
label_desc: Use image node_id 7 for calling a global function with example usage: _log_loss(y, y_pred, w) and returns: np