docstr: Interaction Dependence Component.
  
  Args:
      explainer (Explainer): explainer object constructed with either
                  ClassifierExplainer() or RegressionExplainer()
      title (str, optional): Title of tab or page. Defaults to
                  "What if...".
      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 the title
      hide_subtitle (bool, optional): Hide subtitle. Defaults to False.
      hide_index (bool, optional): hide the index selector
      hide_range (bool, optional): hide the range label under the inputs
      index (str, int, optional): default index
      n_input_cols (int, optional): number of columns to split features inputs in.
          Defaults to 4.
      sort_features(str, optional): how to sort the features. For now only options
          is 'shap' to sort by mean absolute shap value.
      fill_row_first (bool, optional): if True most important features will
          be on top row, if False they will be in most left column.
      description (str, optional): Tooltip to display when hover over
          component title. When None default text is shown.
docstr_tok: ["Interaction","Dependence","Component",".","Args",":","explainer","(","Explainer",")",":","explainer","object","constructed","with","either","ClassifierExplainer","(",")","or","RegressionExplainer","(",")","title","(","str",",","optional",")",":","Title","of","tab","or","page",".","Defaults","to","``","What","if","...","''",".","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","the","title","hide_subtitle","(","bool",",","optional",")",":","Hide","subtitle",".","Defaults","to","False",".","hide_index","(","bool",",","optional",")",":","hide","the","index","selector","hide_range","(","bool",",","optional",")",":","hide","the","range","label","under","the","inputs","index","(","str",",","int",",","optional",")",":","default","index","n_input_cols","(","int",",","optional",")",":","number","of","columns","to","split","features","inputs","in",".","Defaults","to","4.","sort_features","(","str",",","optional",")",":","how","to","sort","the","features",".","For","now","only","options","is","'shap","'","to","sort","by","mean","absolute","shap","value",".","fill_row_first","(","bool",",","optional",")",":","if","True","most","important","features","will","be","on","top","row",",","if","False","they","will","be","in","most","left","column",".","description","(","str",",","optional",")",":","Tooltip","to","display","when","hover","over","component","title",".","When","None","default","text","is","shown","."]
code: def __init__(
      self,
      explainer,
      title="Feature Input",
      name=None,
      subtitle="Adjust the feature values to change the prediction",
      hide_title=False,
      hide_subtitle=False,
      hide_index=False,
      hide_range=False,
      index=None,
      n_input_cols=4,
      sort_features="shap",
      fill_row_first=True,
      description=None,
      **kwargs,
  ):
      """Interaction Dependence Component.
  
      Args:
          explainer (Explainer): explainer object constructed with either
                      ClassifierExplainer() or RegressionExplainer()
          title (str, optional): Title of tab or page. Defaults to
                      "What if...".
          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 the title
          hide_subtitle (bool, optional): Hide subtitle. Defaults to False.
          hide_index (bool, optional): hide the index selector
          hide_range (bool, optional): hide the range label under the inputs
          index (str, int, optional): default index
          n_input_cols (int, optional): number of columns to split features inputs in.
              Defaults to 4.
          sort_features(str, optional): how to sort the features. For now only options
              is 'shap' to sort by mean absolute shap value.
          fill_row_first (bool, optional): if True most important features will
              be on top row, if False they will be in most left column.
          description (str, optional): Tooltip to display when hover over
              component title. When None default text is shown.
  
  
      """
      super().__init__(explainer, title, name)
  
      assert len(explainer.columns) == len(
          set(explainer.columns)
      ), "Not all X column names are unique, so cannot launch FeatureInputComponent component/tab!"
  
      self.index_input = IndexSelector(
          explainer, name="feature-input-index-" + self.name, **kwargs
      )
      self.index_name = "feature-input-index-" + self.name
  
      self._feature_callback_inputs = [
          Input(
              "feature-input-" + feature + "-input-" + self.name,
              "value",
          )
          for feature in self.explainer.columns_ranked_by_shap()
      ]
      self._feature_callback_outputs = [
          Output(
              "feature-input-" + feature + "-input-" + self.name,
              "value",
          )
          for feature in self.explainer.columns_ranked_by_shap()
      ]
  
      if self.sort_features == "shap":
          self._input_features = self.explainer.columns_ranked_by_shap()
      elif self.sort_features == "alphabet":
          self._input_features = sorted(
              self.explainer.merged_cols.tolist()
          )
      else:
          raise ValueError(
              f"parameter sort_features should be either 'shap', "
              "or 'alphabet', but you passed sort_features='{self.sort_features}'"
          )
  
      self._feature_inputs = [
          self._generate_dash_input(
              feature,
              self.explainer.onehot_cols,
              self.explainer.onehot_dict,
              self.explainer.categorical_dict,
          )
          for feature in self._input_features
      ]
  
      self._state_props = {
          feature: (f"feature-input-{feature}-input-", "value")
          for feature in self._input_features
      }
      self._state_props["index"] = ("feature-input-index-", "value")
  
      if self.description is None:
          self.description = """
          Adjust the input values to see predictions for what if scenarios."""
  
imports: from math import ceil
  import numpy
  import pandas
  import dash
  from dash import html, dcc, Input, Output, State, dash_table
  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 FeatureInputComponent object from inherited base classes: ExplainerComponent with example: obj = FeatureInputComponent(explainer, title, name, subtitle, hide_title, hide_subtitle, hide_index, hide_range, index, n_input_cols, sort_features, fill_row_first, description)