code: def fbeta_np(preds, targs, beta, thresh=0.5, epsilon=1e-8):
      
      assert beta > 0, 'beta needs to be greater than 0'
      beta2 = beta ** 2
      rec = recall_np(preds, targs, thresh)
      prec = precision_np(preds, targs, thresh)
      return (1 + beta2) * prec * rec / (beta2 * prec + rec + epsilon)
docs: see fbeta