docstr: Slider to set a cutoff for Classifier components, based on setting the
  cutoff at a certain percentile of predictions, e.g.:
  percentile=0.8 means "mark the 20% highest scores as positive".
  
  This cutoff can then be conencted with other components like e.g.
  RocAucComponent with a CutoffConnector.
  
  Args:
      explainer (Explainer): explainer object constructed with either
                  ClassifierExplainer() or RegressionExplainer()
      title (str, optional): Title of tab or page. Defaults to
                  "Global Cutoff".
      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.
      hide_title (bool, optional): Hide title.
      hide_cutoff (bool, optional): Hide the cutoff slider. Defaults to False.
      hide_percentile (bool, optional): Hide percentile slider. Defaults to False.
      hide_selector (bool, optional): hide pos label selectors. Defaults to False.
      pos_label ({int, str}, optional): initial pos label.
                  Defaults to explainer.pos_label
      cutoff (float, optional): Initial cutoff. Defaults to 0.5.
      percentile ([type], optional): Initial percentile. Defaults to None.
      description (str, optional): Tooltip to display when hover over
          component title. When None default text is shown.
docstr_tok: ["Slider","to","set","a","cutoff","for","Classifier","components",",","based","on","setting","the","cutoff","at","a","certain","percentile","of","predictions",",","e.g",".",":","percentile=0.8","means","``","mark","the","20","%","highest","scores","as","positive","''",".","This","cutoff","can","then","be","conencted","with","other","components","like","e.g",".","RocAucComponent","with","a","CutoffConnector",".","Args",":","explainer","(","Explainer",")",":","explainer","object","constructed","with","either","ClassifierExplainer","(",")","or","RegressionExplainer","(",")","title","(","str",",","optional",")",":","Title","of","tab","or","page",".","Defaults","to","``","Global","Cutoff","''",".","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",".","hide_title","(","bool",",","optional",")",":","Hide","title",".","hide_cutoff","(","bool",",","optional",")",":","Hide","the","cutoff","slider",".","Defaults","to","False",".","hide_percentile","(","bool",",","optional",")",":","Hide","percentile","slider",".","Defaults","to","False",".","hide_selector","(","bool",",","optional",")",":","hide","pos","label","selectors",".","Defaults","to","False",".","pos_label","(","{","int",",","str","}",",","optional",")",":","initial","pos","label",".","Defaults","to","explainer.pos_label","cutoff","(","float",",","optional",")",":","Initial","cutoff",".","Defaults","to","0.5.","percentile","(","[","type","]",",","optional",")",":","Initial","percentile",".","Defaults","to","None",".","description","(","str",",","optional",")",":","Tooltip","to","display","when","hover","over","component","title",".","When","None","default","text","is","shown","."]
code: def __init__(
      self,
      explainer,
      title="Global cutoff",
      name=None,
      hide_title=False,
      hide_cutoff=False,
      hide_percentile=False,
      hide_selector=False,
      pos_label=None,
      cutoff=0.5,
      percentile=None,
      description=None,
      **kwargs,
  ):
      """
      Slider to set a cutoff for Classifier components, based on setting the
      cutoff at a certain percentile of predictions, e.g.:
      percentile=0.8 means "mark the 20% highest scores as positive".
  
      This cutoff can then be conencted with other components like e.g.
      RocAucComponent with a CutoffConnector.
  
      Args:
          explainer (Explainer): explainer object constructed with either
                      ClassifierExplainer() or RegressionExplainer()
          title (str, optional): Title of tab or page. Defaults to
                      "Global Cutoff".
          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.
          hide_title (bool, optional): Hide title.
          hide_cutoff (bool, optional): Hide the cutoff slider. Defaults to False.
          hide_percentile (bool, optional): Hide percentile slider. Defaults to False.
          hide_selector (bool, optional): hide pos label selectors. Defaults to False.
          pos_label ({int, str}, optional): initial pos label.
                      Defaults to explainer.pos_label
          cutoff (float, optional): Initial cutoff. Defaults to 0.5.
          percentile ([type], optional): Initial percentile. Defaults to None.
          description (str, optional): Tooltip to display when hover over
              component title. When None default text is shown.
      """
      super().__init__(explainer, title, name)
  
      self.cutoff_name = "cutoffconnector-cutoff-" + self.name
  
      self.selector = PosLabelSelector(
          explainer, name=self.name, pos_label=pos_label
      )
  
      if self.description is None:
          self.description = """
          Select a model cutoff such that all predicted probabilities higher than
          the cutoff will be labeled positive, and all predicted probabilities 
          lower than the cutoff will be labeled negative. You can also set
          the cutoff as a percenntile of all observations. Setting the cutoff
          here will automatically set the cutoff in multiple other connected
          component. 
          """
      self.register_dependencies(["preds", "pred_percentiles"])
  
imports: import numpy
  import dash
  from dash import html, dcc, Input, Output, State
  from dash.exceptions import PreventUpdate
  import dash_bootstrap_components
  from ..dashboard_methods import *
label_desc: Use image node_id 1 to create a new CutoffPercentileComponent object from inherited base classes: ExplainerComponent with example: obj = CutoffPercentileComponent(explainer, title, name, hide_title, hide_cutoff, hide_percentile, hide_selector, pos_label, cutoff, percentile, description)