class_docstr: Visualizes rules as HTML for both global and local explanations.
docstr: Provides interactive visualizations.
  
  Args:
      key: Either a scalar or list
          that indexes the internal object for sub-plotting.
          If an overall visualization is requested, pass None.
  
  Returns:
      HTML as string.
docstr_tok: ["Provides","interactive","visualizations",".","Args",":","key",":","Either","a","scalar","or","list","that","indexes","the","internal","object","for","sub-plotting",".","If","an","overall","visualization","is","requested",",","pass","None",".","Returns",":","HTML","as","string","."]
code: def visualize(self, key=None):
      """Provides interactive visualizations.
  
      Args:
          key: Either a scalar or list
              that indexes the internal object for sub-plotting.
              If an overall visualization is requested, pass None.
  
      Returns:
          HTML as string.
      """
      from ..visual.plot import rules_to_html
  
      data_dict = self.data(key)
      if data_dict is None:
          return None
  
      # Handle overall graphs
      if key is None and self.explanation_type == "global":
          return rules_to_html(data_dict, title="All Rules")
  
      # Handle local instance graphs
      if self.explanation_type == "local":
          return rules_to_html(data_dict, title="Triggered Rule")
  
      # Handle global feature graphs
      elif self.explanation_type == "global":
          return rules_to_html(
              data_dict,
              title="Rules with Feature: {0}".format(
                  self.feature_names[key]
              ),
          )
      # Handle everything else as invalid
      else:  # pragma: no cover
          msg = "Not suppported: {0}, {1}".format(
              self.explanation_type, key
          )
          _log.error(msg)
          raise Exception(msg)
  
imports: from itertools import count
  from sklearn.base import ClassifierMixin
  from sklearn.utils.validation import check_is_fitted
  from ..api.base import ExplainerMixin, ExplanationMixin
  from ..utils._explanation import gen_name_from_class, gen_global_selector, gen_local_selector, gen_perf_dicts
  from copy import deepcopy
  import numpy
  import pandas
  import re
  from ..utils._clean_x import preclean_X
  from ..utils._clean_simple import clean_dimensions, typify_classification
  from ..utils._unify_data import unify_data
  import logging
label_desc: Use image node_id 3 for calling the RulesExplanation obj's underlying member method code with example usage: obj.visualize(key) and returns: None, rules_to_html, rules_to_html, rules_to_html