class_docstr: Calculatees `Fleiss kappa`_ a statistical measure for inter agreement between raters.
  
  .. math::
      \kappa = \frac{\bar{p} - \bar{p_e}}{1 - \bar{p_e}}
  
  where :math:`\bar{p}` is the mean of the agreement probability over all raters and :math:`\bar{p_e}` is the mean
  agreement probability over all raters if they were randomly assigned. If the raters are in complete agreement then
  the score 1 is returned, if there is no agreement among the raters (other than what would be expected by chance)
  then a score smaller than 0 is returned.
  
  As input to ``forward`` and ``update`` the metric accepts the following input:
  
  - ``ratings`` (:class:`~torch.Tensor`): Ratings of shape ``[n_samples, n_categories]`` or
    ``[n_samples, n_categories, n_raters]`` depedenent on ``mode``. If ``mode`` is ``counts``, ``ratings`` must be
    integer and contain the number of raters that chose each category. If ``mode`` is ``probs``, ``ratings`` must be
    floating point and contain the probability/logits that each rater chose each category.
  
  As output of ``forward`` and ``compute`` the metric returns the following output:
  
  - ``fleiss_k`` (:class:`~torch.Tensor`): A float scalar tensor with the calculated Fleiss' kappa score.
  
  Args:
      mode: Whether `ratings` will be provided as counts or probabilities.
      kwargs: Additional keyword arguments, see :ref:`Metric kwargs` for more info.
  
  Example:
      >>> # Ratings are provided as counts
      >>> import torch
      >>> from torchmetrics.nominal import FleissKappa
      >>> _ = torch.manual_seed(42)
      >>> ratings = torch.randint(0, 10, size=(100, 5)).long()  # 100 samples, 5 categories, 10 raters
      >>> metric = FleissKappa(mode='counts')
      >>> metric(ratings)
      tensor(0.0089)
  
  Example:
      >>> # Ratings are provided as probabilities
      >>> import torch
      >>> from torchmetrics.nominal import FleissKappa
      >>> _ = torch.manual_seed(42)
      >>> ratings = torch.randn(100, 5, 10).softmax(dim=1)  # 100 samples, 5 categories, 10 raters
      >>> metric = FleissKappa(mode='probs')
      >>> metric(ratings)
      tensor(-0.0105)
docstr: Plot a single or multiple values from the metric.
  
  Args:
      val: Either a single result from calling `metric.forward` or `metric.compute` or a list of these results.
          If no value is provided, will automatically call `metric.compute` and plot that result.
      ax: An matplotlib axis object. If provided will add plot to that axis
  
  Returns:
      Figure and Axes object
  
  Raises:
      ModuleNotFoundError:
          If `matplotlib` is not installed
  
  .. plot::
      :scale: 75
  
      >>> # Example plotting a single value
      >>> import torch
      >>> from torchmetrics.nominal import FleissKappa
      >>> metric = FleissKappa(mode="probs")
      >>> metric.update(torch.randn(100, 5, 10).softmax(dim=1))
      >>> fig_, ax_ = metric.plot()
  
  .. plot::
      :scale: 75
  
      >>> # Example plotting multiple values
      >>> import torch
      >>> from torchmetrics.nominal import FleissKappa
      >>> metric = FleissKappa(mode="probs")
      >>> values = [ ]
      >>> for _ in range(10):
      ...     values.append(metric(torch.randn(100, 5, 10).softmax(dim=1)))
      >>> fig_, ax_ = metric.plot(values)
docstr_tok: ["Plot","a","single","or","multiple","values","from","the","metric",".","Args",":","val",":","Either","a","single","result","from","calling","`","metric.forward","`","or","`","metric.compute","`","or","a","list","of","these","results",".","If","no","value","is","provided",",","will","automatically","call","`","metric.compute","`","and","plot","that","result",".","ax",":","An","matplotlib","axis","object",".","If","provided","will","add","plot","to","that","axis","Returns",":","Figure","and","Axes","object","Raises",":","ModuleNotFoundError",":","If","`","matplotlib","`","is","not","installed","..","plot",":",":",":","scale",":","75",">",">",">","#","Example","plotting","a","single","value",">",">",">","import","torch",">",">",">","from","torchmetrics.nominal","import","FleissKappa",">",">",">","metric","=","FleissKappa","(","mode=","''","probs","''",")",">",">",">","metric.update","(","torch.randn","(","100",",","5",",","10",")",".softmax","(","dim=1",")",")",">",">",">","fig_",",","ax_","=","metric.plot","(",")","..","plot",":",":",":","scale",":","75",">",">",">","#","Example","plotting","multiple","values",">",">",">","import","torch",">",">",">","from","torchmetrics.nominal","import","FleissKappa",">",">",">","metric","=","FleissKappa","(","mode=","''","probs","''",")",">",">",">","values","=","[","]",">",">",">","for","_","in","range","(","10",")",":","...","values.append","(","metric","(","torch.randn","(","100",",","5",",","10",")",".softmax","(","dim=1",")",")",")",">",">",">","fig_",",","ax_","=","metric.plot","(","values",")"]
code: def plot(
      self,
      val: Union[Tensor, Sequence[Tensor], None] = None,
      ax: Optional[_AX_TYPE] = None,
  ) -> _PLOT_OUT_TYPE:
      """Plot a single or multiple values from the metric.
  
      Args:
          val: Either a single result from calling `metric.forward` or `metric.compute` or a list of these results.
              If no value is provided, will automatically call `metric.compute` and plot that result.
          ax: An matplotlib axis object. If provided will add plot to that axis
  
      Returns:
          Figure and Axes object
  
      Raises:
          ModuleNotFoundError:
              If `matplotlib` is not installed
  
      .. plot::
          :scale: 75
  
          >>> # Example plotting a single value
          >>> import torch
          >>> from torchmetrics.nominal import FleissKappa
          >>> metric = FleissKappa(mode="probs")
          >>> metric.update(torch.randn(100, 5, 10).softmax(dim=1))
          >>> fig_, ax_ = metric.plot()
  
      .. plot::
          :scale: 75
  
          >>> # Example plotting multiple values
          >>> import torch
          >>> from torchmetrics.nominal import FleissKappa
          >>> metric = FleissKappa(mode="probs")
          >>> values = [ ]
          >>> for _ in range(10):
          ...     values.append(metric(torch.randn(100, 5, 10).softmax(dim=1)))
          >>> fig_, ax_ = metric.plot(values)
  
      """
      return self._plot(val, ax)
  
file_path: torchmetrics/src/torchmetrics/nominal/fleiss_kappa.py
imports: from typing import Any, List, Optional, Sequence, Union
  from torch import Tensor
  from typing_extensions import Literal
  from torchmetrics.functional.nominal.fleiss_kappa import _fleiss_kappa_compute, _fleiss_kappa_update
  from torchmetrics.metric import Metric
  from torchmetrics.utilities.data import dim_zero_cat
  from torchmetrics.utilities.imports import _MATPLOTLIB_AVAILABLE
  from torchmetrics.utilities.plot import _AX_TYPE, _PLOT_OUT_TYPE
label_desc: Use image node_id 4 for calling the FleissKappa obj's underlying member method code with example usage: obj.plot(val, ax) and returns: self