docstr: Convert the histogram to a dict.
  
  the dict is structured as:
  {
      node_id: {
          name: {
              feature_id: {
                  bid: value
              }
          }
      }
  }
docstr_tok: ["Convert","the","histogram","to","a","dict",".","the","dict","is","structured","as",":","{","node_id",":","{","name",":","{","feature_id",":","{","bid",":","value","}","}","}","}"]
code: def to_dict(self, feature_names: typing.List[str] = None):
      """
      Convert the histogram to a dict.
  
      the dict is structured as:
      {
          node_id: {
              name: {
                  feature_id: {
                      bid: value
                  }
              }
          }
      }
      """
      histogram_dict = self._data.to_structured_dict(self._indexer)
      if feature_names is not None:
          histogram_dict_with_names = {}
          for nid, node_data in histogram_dict.items():
              histogram_dict_with_names[nid] = {}
              for name, feature_data in node_data.items():
                  histogram_dict_with_names[nid][name] = {}
                  for fid, bid_data in feature_data.items():
                      histogram_dict_with_names[nid][name][
                          feature_names[fid]
                      ] = bid_data
          return histogram_dict_with_names
      else:
          return histogram_dict
  
file_path: FATE/python/fate/arch/histogram/_histogram_local.py
imports: import logging
  import typing
  from ._histogram_splits import HistogramSplits
  from .indexer import HistogramIndexer, Shuffler
  from .values import HistogramValuesContainer
label_desc: Use image node_id 3 for calling the Histogram obj's underlying member method code with example usage: obj.to_dict(feature_names) and returns: histogram_dict_with_names, histogram_dict