nueramic_mathml.ml.metrics.f_score#

f_score(y_true, y_pred, beta=1)[source]#

Return F_score. https://en.wikipedia.org/wiki/F-score

(1)#\[F_\beta = (1 + \beta^2) \cdot \frac{\mathrm{precision} \cdot \mathrm{recall}} {(\beta^2 \cdot \mathrm{precision}) + \mathrm{recall}}. \]

Note

if beta ** 2 * _precision + _recall == 0, then f_score = 0

Parameters:
  • y_true (Tensor) – array with true values of binary classification

  • y_pred (Tensor) – array with prediction values of binary classification

  • beta (float) – is chosen such that recall is considered beta times as important as precision

Returns:

Return type:

float