code: def _binary_f1_score(y_true, y_pred):
      """Compute f1-score.
  
      Parameters
      ----------
      y_true : array-like, shape=[n-m+1], dtype = int
          True integer labels for each subsequence
      y_pred : array-like, shape=[n-m+1], dtype = int
          Predicted integer labels for each subsequence
  
      Returns
      -------
      F1 : float
          F1-score
      """
      f1_scores = np.zeros(shape=2, dtype=np.float64)
  
      for label in (0, 1):
          tp = np.sum(np.logical_and(y_true == label, y_pred == label))
          fp = np.sum(np.logical_and(y_true != label, y_pred == label))
          fn = np.sum(np.logical_and(y_true == label, y_pred != label))
  
          pr = tp / (tp + fp)
          re = tp / (tp + fn)
  
          f1 = 2 * (pr * re) / (pr + re)
          f1_scores[label] = f1
  
      return np.mean(f1_scores)
  
file_path: sktime/sktime/transformations/series/_clasp_numba.py
imports: import numpy
  import pandas
  from sktime.transformations.panel.matrix_profile import _sliding_dot_products
  from sktime.utils.numba.njit import njit
label_desc: Use image node_id 5 for calling a global function with example usage: _binary_f1_score(y_true, y_pred) and returns: np