class_docstr: Abstract class for confusion matrix
  
  You shouldn't instantiate this class.
  You might instantiate ConfusionMatrix or BinaryConfusionMatrix classes
class_docstr_tok: ["Abstract","class","for","confusion","matrix","You","should","n't","instantiate","this","class",".","You","might","instantiate","ConfusionMatrix","or","BinaryConfusionMatrix","classes"]
docstr: Returns a Pandas DataFrame
docstr_tok: ["Returns","a","Pandas","DataFrame"]
code: def to_dataframe(
      self, normalized=False, calc_sum=False, sum_label="__all__"
  ):
      """
      Returns a Pandas DataFrame
      """
      if normalized:
          a = self._df_confusion.values.astype("float")
          a = a.astype("float") / a.sum(axis=1)[:, np.newaxis]
          df = pd.DataFrame(
              a,
              index=self._df_confusion.index.copy(),
              columns=self._df_confusion.columns.copy(),
          )
      else:
          df = self._df_confusion
  
      if calc_sum:
          df = df.copy()
          df[sum_label] = df.sum(axis=1)
          # df = pd.concat([df, pd.DataFrame(df.sum(axis=1), columns=[sum_label])], axis=1)
          df = pd.concat(
              [df, pd.DataFrame(df.sum(axis=0), columns=[sum_label]).T]
          )
          df.index.name = self.true_name
      return df
  
imports: import numpy
  import pandas
  import collections
  import pandas_ml
  from pandas_ml.confusion_matrix.stats import binom_interval, class_agreement, prop_test
label_desc: Use image node_id 7 for calling the ConfusionMatrixAbstract obj's underlying member method code with example usage: obj.to_dataframe(normalized, calc_sum, sum_label) and returns: df