class_docstr: Compute a classification report as a metric.
  
  Args:
      num_classes (int): the number of classes.
class_docstr_tok: ["Compute","a","classification","report","as","a","metric",".","Args",":","num_classes","(","int",")",":","the","number","of","classes","."]
code: def value(self):
      print("\n" + str(self.class_data))
      fp = self.class_data.sum(axis=0) - np.diag(self.class_data)
      fn = self.class_data.sum(axis=1) - np.diag(self.class_data)
      tp = np.diag(self.class_data)
      tn = self.class_data.sum() - (fp + fn + tp)
      acc = (tp + tn) / np.maximum(1, tp + fp + fn + tn)
      precision = tp / np.maximum(1, tp + fp)
      recall = tp / np.maximum(1, tp + fn)
      return {"accuracy": acc, "precision": precision, "recall": recall}
  
imports: import dataclasses
  import math
  import warnings
  from collections import defaultdict
  import numpy
  import torch
  from sklearn.metrics import confusion_matrix, auc
  from baal.utils.array_utils import to_prob
label_desc: Use image node_id 4 for calling the ClassificationReport obj's underlying member method code with example usage: obj.value() and returns: dict