code: def f_measure(precision, recall, beta=1.0):
      
  
      if precision == 0 and recall == 0:
          return 0.0
  
      return (1 + beta**2)*precision*recall/((beta**2)*precision + recall)
docs: Compute the f-measure from precision and recall scores.
  
      Parameters
      ----------
      precision : float in (0, 1]
          Precision
      recall : float in (0, 1]
          Recall
      beta : float > 0
          Weighting factor for f-measure
          (Default value = 1.0)
  
      Returns
      -------
      f_measure : float
          The weighted f-measure