class_docstr: The source code of this class is under the Apache v2 License and was copied from
  the AllenNLP project and has been modified.
  
  Compute precision, recall, F-measure and support for each class.
  
  The precision is the ratio ``tp / (tp + fp)`` where ``tp`` is the number of
  true positives and ``fp`` the number of false positives. The precision is
  intuitively the ability of the classifier not to label as positive a sample
  that is negative.
  
  The recall is the ratio ``tp / (tp + fn)`` where ``tp`` is the number of
  true positives and ``fn`` the number of false negatives. The recall is
  intuitively the ability of the classifier to find all the positive samples.
  
  The F-beta score can be interpreted as a weighted harmonic mean of
  the precision and recall, where an F-beta score reaches its best
  value at 1 and worst score at 0.
  
  If we have precision and recall, the F-beta score is simply:
  ``F-beta = (1 + beta ** 2) * precision * recall / (beta ** 2 * precision + recall)``
  
  The F-beta score weights recall more than precision by a factor of
  ``beta``. ``beta == 1.0`` means recall and precision are equally important.
  
  The support is the number of occurrences of each class in ``y_true``.
  
  Keys in :class:`logs<poutyne.Callback>` dictionary of callbacks:
      - Train: ``'{metric}_{average}'``
      - Validation: ``'val_{metric}_{average}'``
  
      where ``{metric}`` and ``{average}`` are replaced by the value of their
      respective parameters.
  
  Args:
      metric (Optional[str]): One of {'fscore', 'precision', 'recall'}.
          Whether to return the F-score, the precision or the recall. When not
          provided, all three metrics are returned. (Default value = None)
      average (Union[str, int]): One of {'micro' (default), 'macro', label_number}
          If the argument is of type integer, the score for this class (the label number) is calculated.
          Otherwise, this determines the type of averaging performed on the data:
  
          ``'binary'``:
              Calculate metrics with regard to a single class identified by the
              `pos_label` argument. This is equivalent to `average=pos_label` except
              that the binary mode is enforced, i.e. an exception will be raised if
              there are more than two prediction scores.
          ``'micro'``:
              Calculate metrics globally by counting the total true positives,
              false negatives and false positives.
          ``'macro'``:
              Calculate metrics for each label, and find their unweighted mean.
              This does not take label imbalance into account.
  
          (Default value = 'macro')
      beta (float):
          The strength of recall versus precision in the F-score. (Default value = 1.0)
      pos_label (int):
          The class with respect to which the metric is computed when ``average == 'binary'``. Otherwise, this
          argument has no effect. (Default value = 1)
      ignore_index (int): Specifies a target value that is ignored. This also works in combination with
          a mask if provided. (Default value = -100)
      threshold (float): Threshold for when there is a single score for each prediction. If a sigmoid output is used,
          this should be between 0 and 1. A suggested value would be 0.5. If a logits output is used, the threshold
          would be between -inf and inf. The suggested default value is 0 as to give a probability of 0.5 if a sigmoid
          output were used. (Default = 0)
      names (Optional[Union[str, List[str]]]): The names associated to the metrics. It is a string when
          a single metric is requested. It is a list of 3 strings if all metrics are requested.
          (Default value = None)
      make_deterministic (Optional[bool]): Avoid non-deterministic operations in computations. This might make the
          code slower.
code: def _get_name(self, metric):
      name = metric
      if self._average is not None:
          name += "_" + self._average
      if self._label is not None:
          name += "_" + str(self._label)
      return name
  
imports: import warnings
  from typing import List, Optional, Tuple, Union
  import torch
  from poutyne.framework.metrics.base import Metric
  from poutyne.framework.metrics.metrics_registering import register_metric_class
  from poutyne.framework.metrics.predefined.bincount import _bincount
  from poutyne.utils import set_deterministic_debug_mode
label_desc: Use image node_id 2 for calling the FBeta obj's underlying member method code with example usage: obj._get_name(metric) and returns: name