code: def classification_summary(
      y, t, label_num=None, beta=1.0, ignore_label=-1
  ):
      """Calculates Precision, Recall, F beta Score, and support.
  
      This function calculates the following quantities for each class.
  
      - Precision: :math:`\\frac{\\mathrm{tp}}{\\mathrm{tp} + \\mathrm{fp}}`
      - Recall: :math:`\\frac{\\mathrm{tp}}{\\mathrm{tp} + \\mathrm{fn}}`
      - F beta Score: The weighted harmonic average of Precision and Recall.
      - Support: The number of instances of each ground truth label.
  
      Here, ``tp``, ``fp``, ``tn``, and ``fn`` stand for the number of true
      positives, false positives, true negatives, and false negatives,
      respectively.
  
      ``label_num`` specifies the number of classes, that is,
      each value in ``t`` must be an integer in the range of
      ``[0, label_num)``.
      If ``label_num`` is ``None``, this function regards
      ``label_num`` as a maximum of in ``t`` plus one.
  
      ``ignore_label`` determines which instances should be ignored.
      Specifically, instances with the given label are not taken
      into account for calculating the above quantities.
      By default, it is set to -1 so that all instances are taken
      into consideration, as labels are supposed to be non-negative integers.
      Setting ``ignore_label`` to a non-negative integer less than ``label_num``
      is illegal and yields undefined behavior. In the current implementation,
      it arises ``RuntimeWarning`` and ``ignore_label``-th entries in output
      arrays do not contain correct quantities.
  
      Args:
          y (:class:`~chainer.Variable` or :ref:`ndarray`):
              Variable holding a vector of scores.
          t (:class:`~chainer.Variable` or :ref:`ndarray`):
              Variable holding a vector of ground truth labels.
          label_num (int): The number of classes.
          beta (float): The parameter which determines the weight of
              precision in the F-beta score.
          ignore_label (int): Instances with this label are ignored.
  
      Returns:
          4-tuple of ~chainer.Variable of size ``(label_num,)``.
          Each element represents precision, recall, F beta score,
          and support of this minibatch.
  
      """
      return ClassificationSummary(label_num, beta, ignore_label)(y, t)
  
file_path: chainer/chainer/functions/evaluation/classification_summary.py
imports: from __future__ import division
  import six
  import chainer
  from chainer import backend
  from chainer import function
  from chainer.utils import type_check
label_desc: Use image node_id 2 for calling a global function with example usage: classification_summary(y, t, label_num, beta, ignore_label) and returns: ClassificationSummary