class_docstr: Interpretation methods for classification models.
docstr: Confusion matrix as an `np.ndarray`.
docstr_tok: ["Confusion","matrix","as","an","`","np.ndarray","`","."]
code: def confusion_matrix(self):
      "Confusion matrix as an `np.ndarray`."
      x = torch.arange(0, len(self.vocab))
      _, targs, decoded = self.learn.get_preds(
          dl=self.dl,
          with_decoded=True,
          with_preds=True,
          with_targs=True,
          act=self.act,
      )
      d, t = flatten_check(decoded, targs)
      cm = ((d == x[:, None]) & (t == x[:, None, None])).long().sum(2)
      return to_np(cm)
  
imports: from __future__ import annotations
  from .data.all import *
  from .optimizer import *
  from .learner import *
  from .tabular.core import *
  import sklearn.metrics
label_desc: Use image node_id 2 for calling the ClassificationInterpretation obj's underlying member method code with example usage: obj.confusion_matrix() and returns: to_np