class_docstr: The ``Logger`` class is the ClearML console log and metric statistics interface, and contains methods for explicit
  reporting.
  
  Explicit reporting extends ClearML automagical capturing of inputs and output. Explicit reporting
  methods include scalar plots, line plots, histograms, confusion matrices, 2D and 3D scatter
  diagrams, text logging, tables, and image uploading and reporting.
  
  In the **ClearML Web-App (UI)**, ``Logger`` output appears in the **RESULTS** tab, **CONSOLE**, **SCALARS**,
  **PLOTS**, and **DEBUG SAMPLES** sub-tabs. When you compare experiments, ``Logger`` output appears in the
  comparisons.
  
  .. warning::
  
     Do not construct Logger objects directly.
  
  You must get a Logger object before calling any of the other ``Logger`` class methods by calling
  :meth:`.Task.get_logger` or :meth:`Logger.current_logger`.
class_docstr_tok: ["The","``","Logger","``","class","is","the","ClearML","console","log","and","metric","statistics","interface",",","and","contains","methods","for","explicit","reporting",".","Explicit","reporting","extends","ClearML","automagical","capturing","of","inputs","and","output",".","Explicit","reporting","methods","include","scalar","plots",",","line","plots",",","histograms",",","confusion","matrices",",","2D","and","3D","scatter","diagrams",",","text","logging",",","tables",",","and","image","uploading","and","reporting",".","In","the","*","*","ClearML","Web-App","(","UI",")","*","*",",","``","Logger","``","output","appears","in","the","*","*","RESULTS","*","*","tab",",","*","*","CONSOLE","*","*",",","*","*","SCALARS","*","*",",","*","*","PLOTS","*","*",",","and","*","*","DEBUG","SAMPLES","*","*","sub-tabs",".","When","you","compare","experiments",",","``","Logger","``","output","appears","in","the","comparisons",".","..","warning",":",":","Do","not","construct","Logger","objects","directly",".","You","must","get","a","Logger","object","before","calling","any","of","the","other","``","Logger","``","class","methods","by","calling",":","meth",":","`",".Task.get_logger","`","or",":","meth",":","`","Logger.current_logger","`","."]
docstr: For explicit reporting, plot a heat-map matrix.
  
  For example:
  
  .. code-block:: py
  
     confusion = np.random.randint(10, size=(10, 10))
     logger.report_confusion_matrix("example confusion matrix", "ignored", iteration=1, matrix=confusion,
          xaxis="title X", yaxis="title Y")
  
  :param str title: The title (metric) of the plot.
  :param str series: The series name (variant) of the reported confusion matrix.
  :param numpy.ndarray matrix: A heat-map matrix (example: confusion matrix)
  :param int iteration: The reported iteration / step.
  :param str xaxis: The x-axis title. (Optional)
  :param str yaxis: The y-axis title. (Optional)
  :param list(str) xlabels: Labels for each column of the matrix. (Optional)
  :param list(str) ylabels: Labels for each row of the matrix. (Optional)
  :param bool yaxis_reversed: If False 0,0 is at the bottom left corner. If True, 0,0 is at the top left corner
  :param str comment: A comment displayed with the plot, underneath the title.
  :param dict extra_layout: optional dictionary for layout configuration, passed directly to plotly
      See full details on the supported configuration: https://plotly.com/javascript/reference/heatmap/
      example: extra_layout={'xaxis': {'type': 'date', 'range': ['2020-01-01', '2020-01-31']}}
docstr_tok: ["For","explicit","reporting",",","plot","a","heat-map","matrix",".","For","example",":","..","code-block",":",":","py","confusion","=","np.random.randint","(","10",",","size=","(","10",",","10",")",")","logger.report_confusion_matrix","(","``","example","confusion","matrix","''",",","``","ignored","''",",","iteration=1",",","matrix=confusion",",","xaxis=","''","title","X","''",",","yaxis=","''","title","Y","''",")",":","param","str","title",":","The","title","(","metric",")","of","the","plot",".",":","param","str","series",":","The","series","name","(","variant",")","of","the","reported","confusion","matrix",".",":","param","numpy.ndarray","matrix",":","A","heat-map","matrix","(","example",":","confusion","matrix",")",":","param","int","iteration",":","The","reported","iteration","\/","step",".",":","param","str","xaxis",":","The","x-axis","title",".","(","Optional",")",":","param","str","yaxis",":","The","y-axis","title",".","(","Optional",")",":","param","list","(","str",")","xlabels",":","Labels","for","each","column","of","the","matrix",".","(","Optional",")",":","param","list","(","str",")","ylabels",":","Labels","for","each","row","of","the","matrix",".","(","Optional",")",":","param","bool","yaxis_reversed",":","If","False","0,0","is","at","the","bottom","left","corner",".","If","True",",","0,0","is","at","the","top","left","corner",":","param","str","comment",":","A","comment","displayed","with","the","plot",",","underneath","the","title",".",":","param","dict","extra_layout",":","optional","dictionary","for","layout","configuration",",","passed","directly","to","plotly","See","full","details","on","the","supported","configuration",":","https",":","\/\/plotly.com\/javascript\/reference\/heatmap\/","example",":","extra_layout=","{","'xaxis","'",":","{","'type","'",":","'date","'",",","'range","'",":","[","'2020-01-01","'",",","'2020-01-31","'","]","}","}"]
code: def report_confusion_matrix(
      self,
      title,  # type: str
      series,  # type: str
      matrix,  # type: np.ndarray
      iteration=None,  # type: Optional[int]
      xaxis=None,  # type: Optional[str]
      yaxis=None,  # type: Optional[str]
      xlabels=None,  # type: Optional[List[str]]
      ylabels=None,  # type: Optional[List[str]]
      yaxis_reversed=False,  # type: bool
      comment=None,  # type: Optional[str]
      extra_layout=None,  # type: Optional[dict]
  ):
      """
      For explicit reporting, plot a heat-map matrix.
  
      For example:
  
      .. code-block:: py
  
         confusion = np.random.randint(10, size=(10, 10))
         logger.report_confusion_matrix("example confusion matrix", "ignored", iteration=1, matrix=confusion,
              xaxis="title X", yaxis="title Y")
  
      :param str title: The title (metric) of the plot.
      :param str series: The series name (variant) of the reported confusion matrix.
      :param numpy.ndarray matrix: A heat-map matrix (example: confusion matrix)
      :param int iteration: The reported iteration / step.
      :param str xaxis: The x-axis title. (Optional)
      :param str yaxis: The y-axis title. (Optional)
      :param list(str) xlabels: Labels for each column of the matrix. (Optional)
      :param list(str) ylabels: Labels for each row of the matrix. (Optional)
      :param bool yaxis_reversed: If False 0,0 is at the bottom left corner. If True, 0,0 is at the top left corner
      :param str comment: A comment displayed with the plot, underneath the title.
      :param dict extra_layout: optional dictionary for layout configuration, passed directly to plotly
          See full details on the supported configuration: https://plotly.com/javascript/reference/heatmap/
          example: extra_layout={'xaxis': {'type': 'date', 'range': ['2020-01-01', '2020-01-31']}}
      """
  
      if not isinstance(matrix, np.ndarray):
          matrix = np.array(matrix)
  
      if extra_layout is None:
          extra_layout = {"texttemplate": "%{z}"}
  
      # if task was not started, we have to start it
      self._start_task_if_needed()
      self._touch_title_series(title, series)
      # noinspection PyProtectedMember
      return self._task._reporter.report_value_matrix(
          title=title,
          series=series,
          data=matrix.astype(np.float32),
          iter=iteration or 0,
          xtitle=xaxis,
          ytitle=yaxis,
          xlabels=xlabels,
          ylabels=ylabels,
          yaxis_reversed=yaxis_reversed,
          comment=comment,
          layout_config=extra_layout,
      )
  
imports: import logging
  import math
  import warnings
  from typing import Any, Sequence, Union, List, Optional, Tuple, Dict, TYPE_CHECKING
  import numpy
  import six
  from PIL import Image
  from pathlib2 import Path
  from .debugging.log import LoggerRoot
  from .backend_interface.logger import StdStreamPatch
  from .backend_interface.task import Task
  from .backend_interface.task.log import TaskHandler
  from .backend_interface.util import mutually_exclusive
  from .backend_interface.metrics.events import UploadEvent, MetricsEventAdapter
  from .config import running_remotely, get_cache_dir, config, DEBUG_SIMULATE_REMOTE_TASK, deferred_config
  from .errors import UsageError
  from .storage.helper import StorageHelper
  from .utilities.plotly_reporter import SeriesInfo
label_desc: Use image node_id 12 for calling the Logger obj's underlying member method code with example usage: obj.report_confusion_matrix(title, series, matrix, iteration, xaxis, yaxis, xlabels, ylabels, yaxis_reversed, comment, extra_layout) and returns: self