code: def layout(self):
      return dbc.Card(
          [
              make_hideable(
                  dbc.CardHeader(
                      [
                          html.Div(
                              [
                                  html.H3(
                                      self.title,
                                      id="random-index-reg-title-"
                                      + self.name,
                                  ),
                                  make_hideable(
                                      html.H6(
                                          self.subtitle,
                                          className="card-subtitle",
                                      ),
                                      hide=self.hide_subtitle,
                                  ),
                                  dbc.Tooltip(
                                      self.description,
                                      target="random-index-reg-title-"
                                      + self.name,
                                  ),
                              ]
                          ),
                      ]
                  ),
                  hide=self.hide_title,
              ),
              dbc.CardBody(
                  [
                      dbc.Row(
                          [
                              make_hideable(
                                  dbc.Col(
                                      [self.index_selector.layout()],
                                      md=8,
                                  ),
                                  hide=self.hide_index,
                              ),
                              make_hideable(
                                  dbc.Col(
                                      [
                                          dbc.Button(
                                              f"Random {self.explainer.index_name}",
                                              color="primary",
                                              id="random-index-reg-button-"
                                              + self.name,
                                          ),
                                          dbc.Tooltip(
                                              f"Select a random {self.explainer.index_name} according to the constraints",
                                              target="random-index-reg-button-"
                                              + self.name,
                                          ),
                                      ],
                                      md=4,
                                  ),
                                  hide=self.hide_button,
                              ),
                          ]
                      ),
                      dbc.Row(
                          [
                              make_hideable(
                                  dbc.Col(
                                      [
                                          html.Div(
                                              [
                                                  dbc.Label(
                                                      "Predicted range:",
                                                      id="random-index-reg-pred-slider-label-"
                                                      + self.name,
                                                      html_for="random-index-reg-pred-slider-"
                                                      + self.name,
                                                  ),
                                                  dbc.Tooltip(
                                                      f"Only select {self.explainer.index_name} where the "
                                                      f"predicted {self.explainer.target} was within the following range:",
                                                      target="random-index-reg-pred-slider-label-"
                                                      + self.name,
                                                  ),
                                                  dcc.RangeSlider(
                                                      id="random-index-reg-pred-slider-"
                                                      + self.name,
                                                      min=float(
                                                          self.explainer.preds.min()
                                                      ),
                                                      max=float(
                                                          self.explainer.preds.max()
                                                      ),
                                                      step=np.float_power(
                                                          10,
                                                          -self.round,
                                                      ),
                                                      value=[
                                                          self.pred_slider[
                                                              0
                                                          ],
                                                          self.pred_slider[
                                                              1
                                                          ],
                                                      ],
                                                      marks={
                                                          float(
                                                              self.explainer.preds.min()
                                                          ): str(
                                                              np.round(
                                                                  self.explainer.preds.min(),
                                                                  self.round,
                                                              )
                                                          ),
                                                          float(
                                                              self.explainer.preds.max()
                                                          ): str(
                                                              np.round(
                                                                  self.explainer.preds.max(),
                                                                  self.round,
                                                              )
                                                          ),
                                                      },
                                                      allowCross=False,
                                                      tooltip={
                                                          "always_visible": False
                                                      },
                                                  ),
                                              ],
                                              id="random-index-reg-pred-slider-div-"
                                              + self.name,
                                          ),
                                          html.Div(
                                              [
                                                  dbc.Label(
                                                      "Observed range:",
                                                      id="random-index-reg-y-slider-label-"
                                                      + self.name,
                                                      html_for="random-index-reg-y-slider-"
                                                      + self.name,
                                                  ),
                                                  dbc.Tooltip(
                                                      f"Only select {self.explainer.index_name} where the "
                                                      f"observed {self.explainer.target} was within the following range:",
                                                      target="random-index-reg-y-slider-label-"
                                                      + self.name,
                                                  ),
                                                  dcc.RangeSlider(
                                                      id="random-index-reg-y-slider-"
                                                      + self.name,
                                                      min=float(
                                                          self.explainer.y.min()
                                                      ),
                                                      max=float(
                                                          self.explainer.y.max()
                                                      ),
                                                      step=np.float_power(
                                                          10,
                                                          -self.round,
                                                      ),
                                                      value=[
                                                          self.y_slider[
                                                              0
                                                          ],
                                                          self.y_slider[
                                                              1
                                                          ],
                                                      ],
                                                      marks={
                                                          float(
                                                              self.explainer.y.min()
                                                          ): str(
                                                              np.round(
                                                                  self.explainer.y.min(),
                                                                  self.round,
                                                              )
                                                          ),
                                                          float(
                                                              self.explainer.y.max()
                                                          ): str(
                                                              np.round(
                                                                  self.explainer.y.max(),
                                                                  self.round,
                                                              )
                                                          ),
                                                      },
                                                      allowCross=False,
                                                      tooltip={
                                                          "always_visible": False
                                                      },
                                                  ),
                                              ],
                                              id="random-index-reg-y-slider-div-"
                                              + self.name,
                                          ),
                                      ],
                                      md=8,
                                  ),
                                  hide=self.hide_pred_slider,
                              ),
                              make_hideable(
                                  dbc.Col(
                                      [
                                          dbc.Label(
                                              "Range:",
                                              id="random-index-reg-preds-or-y-label-"
                                              + self.name,
                                              html_for="random-index-reg-preds-or-y-"
                                              + self.name,
                                          ),
                                          dbc.Select(
                                              id="random-index-reg-preds-or-y-"
                                              + self.name,
                                              options=[
                                                  {
                                                      "label": "Predicted",
                                                      "value": "preds",
                                                  },
                                                  {
                                                      "label": "Observed",
                                                      "value": "y",
                                                  },
                                              ],
                                              value=self.pred_or_y,
                                          ),
                                          dbc.Tooltip(
                                              f"You can either only select a random {self.explainer.index_name}"
                                              f"from within a certain range of observed {self.explainer.target} or"
                                              f"from within a certain range of predicted {self.explainer.target}.",
                                              target="random-index-reg-preds-or-y-label-"
                                              + self.name,
                                          ),
                                      ],
                                      md=4,
                                  ),
                                  hide=self.hide_pred_or_y,
                              ),
                          ]
                      ),
                      dbc.Row(
                          [
                              make_hideable(
                                  dbc.Col(
                                      [
                                          html.Div(
                                              [
                                                  dbc.Label(
                                                      "Residuals range:",
                                                      id="random-index-reg-residual-slider-label-"
                                                      + self.name,
                                                      html_for="random-index-reg-residual-slider-"
                                                      + self.name,
                                                  ),
                                                  dbc.Tooltip(
                                                      f"Only select {self.explainer.index_name} where the "
                                                      f"residual (difference between observed {self.explainer.target} and predicted {self.explainer.target})"
                                                      " was within the following range:",
                                                      target="random-index-reg-residual-slider-label-"
                                                      + self.name,
                                                  ),
                                                  dcc.RangeSlider(
                                                      id="random-index-reg-residual-slider-"
                                                      + self.name,
                                                      min=float(
                                                          self.explainer.residuals.min()
                                                      ),
                                                      max=float(
                                                          self.explainer.residuals.max()
                                                      ),
                                                      step=float(
                                                          np.float_power(
                                                              10,
                                                              -self.round,
                                                          )
                                                      ),
                                                      value=[
                                                          float(
                                                              self.residual_slider[
                                                                  0
                                                              ]
                                                          ),
                                                          float(
                                                              self.residual_slider[
                                                                  1
                                                              ]
                                                          ),
                                                      ],
                                                      marks={
                                                          float(
                                                              self.explainer.residuals.min()
                                                          ): str(
                                                              np.round(
                                                                  self.explainer.residuals.min(),
                                                                  self.round,
                                                              )
                                                          ),
                                                          float(
                                                              self.explainer.residuals.max()
                                                          ): str(
                                                              np.round(
                                                                  self.explainer.residuals.max(),
                                                                  self.round,
                                                              )
                                                          ),
                                                      },
                                                      allowCross=False,
                                                      tooltip={
                                                          "always_visible": False
                                                      },
                                                  ),
                                              ],
                                              id="random-index-reg-residual-slider-div-"
                                              + self.name,
                                          ),
                                          html.Div(
                                              [
                                                  dbc.Label(
                                                      "Absolute residuals",
                                                      id="random-index-reg-abs-residual-slider-label"
                                                      + self.name,
                                                      html_for="random-index-reg-abs-residual-slider-"
                                                      + self.name,
                                                  ),
                                                  dbc.Tooltip(
                                                      f"Only select {self.explainer.index_name} where the absolute "
                                                      f"residual (difference between observed {self.explainer.target} and predicted {self.explainer.target})"
                                                      " was within the following range:",
                                                      target="random-index-reg-abs-residual-slider-label"
                                                      + self.name,
                                                  ),
                                                  dcc.RangeSlider(
                                                      id="random-index-reg-abs-residual-slider-"
                                                      + self.name,
                                                      min=float(
                                                          self.explainer.abs_residuals.min()
                                                      ),
                                                      max=float(
                                                          self.explainer.abs_residuals.max()
                                                      ),
                                                      step=float(
                                                          np.float_power(
                                                              10,
                                                              -self.round,
                                                          )
                                                      ),
                                                      value=[
                                                          float(
                                                              self.abs_residual_slider[
                                                                  0
                                                              ]
                                                          ),
                                                          float(
                                                              self.abs_residual_slider[
                                                                  1
                                                              ]
                                                          ),
                                                      ],
                                                      marks={
                                                          float(
                                                              self.explainer.abs_residuals.min()
                                                          ): str(
                                                              np.round(
                                                                  self.explainer.abs_residuals.min(),
                                                                  self.round,
                                                              )
                                                          ),
                                                          float(
                                                              self.explainer.abs_residuals.max()
                                                          ): str(
                                                              np.round(
                                                                  self.explainer.abs_residuals.max(),
                                                                  self.round,
                                                              )
                                                          ),
                                                      },
                                                      allowCross=False,
                                                      tooltip={
                                                          "always_visible": False
                                                      },
                                                  ),
                                              ],
                                              id="random-index-reg-abs-residual-slider-div-"
                                              + self.name,
                                          ),
                                      ],
                                      md=8,
                                  ),
                                  hide=self.hide_residual_slider,
                              ),
                              make_hideable(
                                  dbc.Col(
                                      [
                                          dbc.Label(
                                              "Residuals:",
                                              id="random-index-reg-abs-residual-label-"
                                              + self.name,
                                              html_for="random-index-reg-abs-residual-"
                                              + self.name,
                                          ),
                                          dbc.Select(
                                              id="random-index-reg-abs-residual-"
                                              + self.name,
                                              options=[
                                                  {
                                                      "label": "Residuals",
                                                      "value": "relative",
                                                  },
                                                  {
                                                      "label": "Absolute Residuals",
                                                      "value": "absolute",
                                                  },
                                              ],
                                              value="absolute"
                                              if self.abs_residuals
                                              else "relative",
                                          ),
                                          dbc.Tooltip(
                                              f"You can either only select random a {self.explainer.index_name} "
                                              f"from within a certain range of residuals "
                                              f"(difference between observed and predicted {self.explainer.target}), "
                                              f"so for example only {self.explainer.index_name} for whom the prediction "
                                              f"was too high or too low."
                                              f"Or you can select only from a certain absolute residual range. So for "
                                              f"example only select {self.explainer.index_name} for which the prediction was at "
                                              f"least a certain amount of {self.explainer.units} off.",
                                              target="random-index-reg-abs-residual-label-"
                                              + self.name,
                                          ),
                                      ],
                                      md=4,
                                  ),
                                  hide=self.hide_abs_residuals,
                              ),
                          ]
                      ),
                  ]
              ),
          ]
      )
  
imports: import numpy
  import pandas
  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 2 for calling the RegressionRandomIndexComponent obj's underlying member method code with example usage: obj.layout() and returns: dbc