docs: def to_dataframe(self):
      """Convert the confusion matrix to a dataframe.
  
      Returns:
        A DataFrame with "target", "predicted", "count" columns.
      """
  
      data = []
      for target_index, target_row in enumerate(self._cm):
        for predicted_index, count in enumerate(target_row):
          data.append((self._labels[target_index], self._labels[predicted_index], count))
  
      return pd.DataFrame(data, columns=['target', 'predicted', 'count'])