class_docstr: Render confusion matrix for binary/multiclass classificator.
  
  This visualization depends on :py:class:`~autogluon.eda.analysis.model.AutoGluonModelEvaluator` analysis.
  
  Parameters
  ----------
  headers: bool, default = False
      if `True` then render headers
  namespace: str, default = None
      namespace to use; can be nested like `ns_a.ns_b.ns_c`
  fig_args: Optional[Dict[str, Any]] = None,
      kwargs to pass into chart figure
  
  Examples
  --------
  >>> import autogluon.eda.analysis as eda
  >>> import autogluon.eda.visualization as viz
  >>> import autogluon.eda.auto as auto
  >>>
  >>> df_train = ...
  >>> df_test = ...
  >>> predictor = ...
  >>>
  >>> auto.analyze(model=predictor, val_data=df_test, anlz_facets=[
  >>>     eda.model.AutoGluonModelEvaluator(),
  >>> ], viz_facets=[
  >>>     viz.model.ConfusionMatrix(fig_args=dict(figsize=(3,3)), annot_kws={"size": 12}),
  >>> ])
  
  See Also
  --------
  :py:class:`~autogluon.eda.analysis.model.AutoGluonModelEvaluator`
class_docstr_tok: ["Render","confusion","matrix","for","binary\/multiclass","classificator",".","This","visualization","depends","on",":","py",":","class",":","`","~autogluon.eda.analysis.model.AutoGluonModelEvaluator","`","analysis",".","Parameters","--","--","--","--","--","headers",":","bool",",","default","=","False","if","`","True","`","then","render","headers","namespace",":","str",",","default","=","None","namespace","to","use",";","can","be","nested","like","`","ns_a.ns_b.ns_c","`","fig_args",":","Optional","[","Dict","[","str",",","Any","]","]","=","None",",","kwargs","to","pass","into","chart","figure","Examples","--","--","--","--",">",">",">","import","autogluon.eda.analysis","as","eda",">",">",">","import","autogluon.eda.visualization","as","viz",">",">",">","import","autogluon.eda.auto","as","auto",">",">",">",">",">",">","df_train","=","...",">",">",">","df_test","=","...",">",">",">","predictor","=","...",">",">",">",">",">",">","auto.analyze","(","model=predictor",",","val_data=df_test",",","anlz_facets=","[",">",">",">","eda.model.AutoGluonModelEvaluator","(",")",",",">",">",">","]",",","viz_facets=","[",">",">",">","viz.model.ConfusionMatrix","(","fig_args=dict","(","figsize=","(","3,3",")",")",",","annot_kws=","{","``","size","''",":","12","}",")",",",">",">",">","]",")","See","Also","--","--","--","--",":","py",":","class",":","`","~autogluon.eda.analysis.model.AutoGluonModelEvaluator","`"]
code: def _render(self, state: AnalysisState) -> None:
      self.render_header_if_needed(state, "Confusion Matrix")
      labels = state.model_evaluation.labels
      cm = pd.DataFrame(
          state.model_evaluation.confusion_matrix,
          columns=labels,
          index=labels,
      )
      cm.index.name = "Actual"
      cm.columns.name = "Predicted"
      normalized = state.model_evaluation.confusion_matrix_normalized
      fmt = ",.2%" if normalized else "d"
  
      cells_num = len(cm)
      fig_args = self.fig_args.copy()
      if "figsize" not in fig_args:
          fig_args["figsize"] = (cells_num, cells_num)
  
      fig, ax = plt.subplots(**fig_args)
      sns.heatmap(
          cm,
          ax=ax,
          cmap="Blues",
          annot=True,
          linewidths=0.5,
          linecolor="lightgrey",
          fmt=fmt,
          cbar=False,
          **self._kwargs,
      )
      plt.show(fig)
  
imports: from typing import Any, Dict, Optional
  import matplotlib.pyplot
  import pandas
  import seaborn
  from yellowbrick.contrib.wrapper import REGRESSOR, ContribEstimator
  from yellowbrick.regressor import residuals_plot
  from autogluon.core.constants import REGRESSION
  from ..state import AnalysisState
  from .base import AbstractVisualization
  from .jupyter import JupyterMixin
label_desc: Use image node_id 3 for calling the ConfusionMatrix obj's underlying member method code with example usage: obj._render(state) without return types