class_docstr: Visualizes specifically for Linear methods.
class_docstr_tok: ["Visualizes","specifically","for","Linear","methods","."]
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:
      A Plotly figure.
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",":","A","Plotly","figure","."]
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:
          A Plotly figure.
      """
      from ..visual.plot import (
          sort_take,
          mli_sort_take,
          get_sort_indexes,
          get_explanation_index,
          plot_horizontal_bar,
          mli_plot_horizontal_bar,
      )
  
      if isinstance(key, tuple) and len(key) == 2:
          provider, key = key
          if (
              "mli" == provider
              and "mli" in self.data(-1)
              and self.explanation_type == "global"
          ):
              explanation_list = self.data(-1)["mli"]
              explanation_index = get_explanation_index(
                  explanation_list, "global_feature_importance"
              )
              scores = explanation_list[explanation_index]["value"][
                  "scores"
              ]
              sort_indexes = get_sort_indexes(
                  scores, sort_fn=lambda x: -abs(x), top_n=15
              )
              sorted_scores = mli_sort_take(
                  scores, sort_indexes, reverse_results=True
              )
              sorted_names = mli_sort_take(
                  self.feature_names, sort_indexes, reverse_results=True
              )
              return mli_plot_horizontal_bar(
                  sorted_scores,
                  sorted_names,
                  title="Overall Importance:<br>Coefficients",
              )
          else:  # pragma: no cover
              raise RuntimeError(
                  "Visual provider {} not supported".format(provider)
              )
      else:
          data_dict = self.data(key)
          if data_dict is None:
              return None
  
          if self.explanation_type == "global" and key is None:
              data_dict = sort_take(
                  data_dict,
                  sort_fn=lambda x: -abs(x),
                  top_n=15,
                  reverse_results=True,
              )
              figure = plot_horizontal_bar(
                  data_dict, title="Overall Importance:<br>Coefficients"
              )
              return figure
  
      return super().visualize(key)
  
imports: from ..api.base import ExplainerMixin
  from ..api.templates import FeatureValueExplanation
  from ..utils._explanation import gen_name_from_class, gen_global_selector, gen_local_selector
  from ..utils._explanation import gen_perf_dicts
  from abc import abstractmethod
  from sklearn.base import is_classifier
  from sklearn.utils.validation import check_is_fitted
  import numpy
  from sklearn.base import ClassifierMixin, RegressorMixin
  from sklearn.linear_model import LogisticRegression
  from sklearn.linear_model import LinearRegression
  from ..utils._clean_x import preclean_X
  from ..utils._clean_simple import clean_dimensions, typify_classification
  from ..utils._unify_data import unify_data
label_desc: Use image node_id 2 for calling the LinearExplanation obj's underlying member method code with example usage: obj.visualize(key) and returns: super, mli_plot_horizontal_bar, None, figure