def fbeta_score(y_real, y_pred, beta):
 (_, _, f) = precision_recall_fscore(y_real, y_pred, beta=beta)
 return np.average(f)

def fbeta_score ( y_real , y_pred , beta ) : ( _ , _ , f ) = precision_recall_fscore ( y_real , y_pred , beta = beta ) return np . average ( f )
compute the f-beta score the f-beta score is the weighted harmonic mean of precision and recall .