class_docstr: A class to store and visualize the resulting counterfactual explanations.
class_docstr_tok: ["A","class","to","store","and","visualize","the","resulting","counterfactual","explanations","."]
code: def _visualize_internal(
      self,
      display_sparse_df=True,
      show_only_changes=False,
      is_notebook_console=False,
  ):
      if self.final_cfs_df is not None and len(self.final_cfs_df) > 0:
          if self.posthoc_sparsity_param is None:
              print(
                  "\nCounterfactual set (new outcome: {0})".format(
                      self.new_outcome
                  )
              )
              self._dump_output(
                  content=self.final_cfs_df,
                  show_only_changes=show_only_changes,
                  is_notebook_console=is_notebook_console,
              )
          elif (
              hasattr(self.data_interface, "data_df")
              and display_sparse_df is True
              and self.final_cfs_df_sparse is not None
          ):
              # CFs
              print(
                  "\nDiverse Counterfactual set (new outcome: {0})".format(
                      self.new_outcome
                  )
              )
              self._dump_output(
                  content=self.final_cfs_df_sparse,
                  show_only_changes=show_only_changes,
                  is_notebook_console=is_notebook_console,
              )
          elif (
              hasattr(self.data_interface, "data_df")
              and display_sparse_df is True
              and self.final_cfs_df_sparse is None
          ):
              print(
                  "\nPlease specify a valid posthoc_sparsity_param to perform sparsity correction.. ",
                  "displaying Diverse Counterfactual set without",
                  "sparsity correction (new outcome : {})".format(
                      self.new_outcome
                  ),
              )
              self._dump_output(
                  content=self.final_cfs_df,
                  show_only_changes=show_only_changes,
                  is_notebook_console=is_notebook_console,
              )
          elif not hasattr(
              self.data_interface, "data_df"
          ):  # for private data
              print(
                  "\nDiverse Counterfactual set without sparsity correction since only metadata about each",
                  " feature is available (new outcome: {}".format(
                      self.new_outcome
                  ),
              )
              self._dump_output(
                  content=self.final_cfs_df,
                  show_only_changes=show_only_changes,
                  is_notebook_console=is_notebook_console,
              )
          else:
              # CFs
              print(
                  "\nDiverse Counterfactual set without sparsity correction (new outcome: ",
                  self.new_outcome,
              )
              self._dump_output(
                  content=self.final_cfs_df,
                  show_only_changes=show_only_changes,
                  is_notebook_console=is_notebook_console,
              )
      else:
          print("\nNo counterfactuals found!")
  
imports: import copy
  import json
  import math
  import numpy
  import pandas
  from dice_ml.constants import ModelTypes, _SchemaVersions
  from dice_ml.utils.serialize import DummyDataInterface
label_desc: Use image node_id 4 for calling the CounterfactualExamples obj's underlying member method code with example usage: obj._visualize_internal(display_sparse_df, show_only_changes, is_notebook_console) without return types