docstr: Show SHAP values contributions to prediction in a table component
  
  Args:
      explainer (Explainer): explainer object constructed with either
                  ClassifierExplainer() or RegressionExplainer()
      title (str, optional): Title of tab or page. Defaults to
                  "Contributions Table".
      name (str, optional): unique name to add to Component elements.
                  If None then random uuid is generated to make sure
                  it's unique. Defaults to None.
      subtitle (str): subtitle
      hide_title (bool, optional): Hide component title. Defaults to False.
      hide_subtitle (bool, optional): Hide subtitle. Defaults to False.
      hide_index (bool, optional): Hide index selector. Defaults to False.
      hide_depth (bool, optional): Hide depth selector. Defaults to False.
      hide_sort (bool, optional): Hide sorting dropdown. Default to False.
      hide_selector (bool, optional): hide pos label selector. Defaults to False.
      feature_input_component (FeatureInputComponent): A FeatureInputComponent
          that will give the input to the graph instead of the index selector.
          If not None, hide_index=True. Defaults to None.
      index_dropdown (bool, optional): Use dropdown for index input instead
          of free text input. Defaults to True.
      pos_label ({int, str}, optional): initial pos label.
                  Defaults to explainer.pos_label
      index ([type], optional): Initial index to display. Defaults to None.
      depth ([type], optional): Initial number of features to display. Defaults to None.
      sort ({'abs', 'high-to-low', 'low-to-high', 'importance'}, optional): sorting of shap values.
                  Defaults to 'high-to-low'.
      description (str, optional): Tooltip to display when hover over
          component title. When None default text is shown.
docstr_tok: ["Show","SHAP","values","contributions","to","prediction","in","a","table","component","Args",":","explainer","(","Explainer",")",":","explainer","object","constructed","with","either","ClassifierExplainer","(",")","or","RegressionExplainer","(",")","title","(","str",",","optional",")",":","Title","of","tab","or","page",".","Defaults","to","``","Contributions","Table","''",".","name","(","str",",","optional",")",":","unique","name","to","add","to","Component","elements",".","If","None","then","random","uuid","is","generated","to","make","sure","it","'s","unique",".","Defaults","to","None",".","subtitle","(","str",")",":","subtitle","hide_title","(","bool",",","optional",")",":","Hide","component","title",".","Defaults","to","False",".","hide_subtitle","(","bool",",","optional",")",":","Hide","subtitle",".","Defaults","to","False",".","hide_index","(","bool",",","optional",")",":","Hide","index","selector",".","Defaults","to","False",".","hide_depth","(","bool",",","optional",")",":","Hide","depth","selector",".","Defaults","to","False",".","hide_sort","(","bool",",","optional",")",":","Hide","sorting","dropdown",".","Default","to","False",".","hide_selector","(","bool",",","optional",")",":","hide","pos","label","selector",".","Defaults","to","False",".","feature_input_component","(","FeatureInputComponent",")",":","A","FeatureInputComponent","that","will","give","the","input","to","the","graph","instead","of","the","index","selector",".","If","not","None",",","hide_index=True",".","Defaults","to","None",".","index_dropdown","(","bool",",","optional",")",":","Use","dropdown","for","index","input","instead","of","free","text","input",".","Defaults","to","True",".","pos_label","(","{","int",",","str","}",",","optional",")",":","initial","pos","label",".","Defaults","to","explainer.pos_label","index","(","[","type","]",",","optional",")",":","Initial","index","to","display",".","Defaults","to","None",".","depth","(","[","type","]",",","optional",")",":","Initial","number","of","features","to","display",".","Defaults","to","None",".","sort","(","{","'abs","'",",","'high-to-low","'",",","'low-to-high","'",",","'importance","'","}",",","optional",")",":","sorting","of","shap","values",".","Defaults","to","'high-to-low","'",".","description","(","str",",","optional",")",":","Tooltip","to","display","when","hover","over","component","title",".","When","None","default","text","is","shown","."]
code: def __init__(
      self,
      explainer,
      title="Contributions Table",
      name=None,
      subtitle="How has each feature contributed to the prediction?",
      hide_title=False,
      hide_subtitle=False,
      hide_index=False,
      hide_depth=False,
      hide_sort=False,
      hide_selector=False,
      feature_input_component=None,
      index_dropdown=True,
      pos_label=None,
      index=None,
      depth=None,
      sort="abs",
      description=None,
      **kwargs,
  ):
      """Show SHAP values contributions to prediction in a table component
  
      Args:
          explainer (Explainer): explainer object constructed with either
                      ClassifierExplainer() or RegressionExplainer()
          title (str, optional): Title of tab or page. Defaults to
                      "Contributions Table".
          name (str, optional): unique name to add to Component elements.
                      If None then random uuid is generated to make sure
                      it's unique. Defaults to None.
          subtitle (str): subtitle
          hide_title (bool, optional): Hide component title. Defaults to False.
          hide_subtitle (bool, optional): Hide subtitle. Defaults to False.
          hide_index (bool, optional): Hide index selector. Defaults to False.
          hide_depth (bool, optional): Hide depth selector. Defaults to False.
          hide_sort (bool, optional): Hide sorting dropdown. Default to False.
          hide_selector (bool, optional): hide pos label selector. Defaults to False.
          feature_input_component (FeatureInputComponent): A FeatureInputComponent
              that will give the input to the graph instead of the index selector.
              If not None, hide_index=True. Defaults to None.
          index_dropdown (bool, optional): Use dropdown for index input instead
              of free text input. Defaults to True.
          pos_label ({int, str}, optional): initial pos label.
                      Defaults to explainer.pos_label
          index ([type], optional): Initial index to display. Defaults to None.
          depth ([type], optional): Initial number of features to display. Defaults to None.
          sort ({'abs', 'high-to-low', 'low-to-high', 'importance'}, optional): sorting of shap values.
                      Defaults to 'high-to-low'.
          description (str, optional): Tooltip to display when hover over
              component title. When None default text is shown.
      """
      super().__init__(explainer, title, name)
  
      self.index_name = "contributions-table-index-" + self.name
  
      if self.depth is not None:
          self.depth = min(self.depth, self.explainer.n_features)
      else:
          self.depth = self.explainer.n_features
  
      if self.feature_input_component is not None:
          self.exclude_callbacks(self.feature_input_component)
          self.hide_index = True
  
      if self.description is None:
          self.description = """
          This tables shows the contribution that each individual feature has had
          on the prediction for a specific observation. The contributions (starting
          from the population average) add up to the final prediction. This allows you
          to explain exactly how each individual prediction has been built up
          from all the individual ingredients in the model.
          """
      self.selector = PosLabelSelector(
          explainer, name=self.name, pos_label=pos_label
      )
      self.index_selector = IndexSelector(
          explainer,
          "contributions-table-index-" + self.name,
          index=index,
          index_dropdown=index_dropdown,
          **kwargs,
      )
  
      self.register_dependencies("shap_values_df")
  
imports: import dash
  from dash import html, dcc, Input, Output, State
  from dash.exceptions import PreventUpdate
  import dash_bootstrap_components
  from ..dashboard_methods import *
  from ..None import to_html
label_desc: Use image node_id 1 to create a new ShapContributionsTableComponent object from inherited base classes: ExplainerComponent with example: obj = ShapContributionsTableComponent(explainer, title, name, subtitle, hide_title, hide_subtitle, hide_index, hide_depth, hide_sort, hide_selector, feature_input_component, index_dropdown, pos_label, index, depth, sort, description)