class_docstr: Computes predictive differences and their uncertainty intervals for
  'comparisons' and 'slopes' effects and returns a summary dataframe of the
  results.
  
  Parameters
  ----------
  model : Model
      Bambi model object.
  preds_data : pd.DataFrame
      Dataframe used to generate predictions.
  variable : VariableInfo
      Variable of interest with its name and values.
  conditional : ConditionalInfo
      Conditional covariates with their names and values (if any).
  response : ResponseInfo
      Response variable with its name and target.
  use_hdi : bool
      Whether to use the highest density interval (HDI) (True) or quantiles (False).
  kind : str
      Type of effect to compute. Either 'comparisons' or 'slopes'.
  
  Returns
  -------
  summary_df : pd.DataFrame
      Dataframe with the data used to generate predictions, the effect kind
      and type, variable of interest name and value, and the mean and uncertainty
      intervals of the predictive difference estimate.
docstr: Obtain the effect ('comparisons' or 'slopes') estimate and uncertainty
  interval using the posterior samples. First, the posterior samples are
  subsetted by the variable of interest's values. Then, the effect is
  computed for each pairwise combination of the variable of interest's
  values.
  
  Parameters
  ----------
  idata : az.InferenceData
      InferenceData object containing the posterior samples for the model.
  response_transforms : dict
      Dictionary with the response variable name as key and the
      transformation function as value.
  comparison_type : str
      Type of comparison to compute. Either 'diff' or 'ratio'. Defaults
      to 'diff'.
  slope : str
      Type of slope to compute. Either 'dydx', 'dyex', 'eyex', 'eydx'.
      Defaults to 'dydx'.
  eps : float
      Value to add to the variable of interest's values to compute the
      slope. Defaults to None.
  prob : float
      Probability for the uncertainty interval. Defaults to 0.94.
  
  Returns
  -------
  estimate : Estimate
      Estimate object with the effect estimate mean  and uncertainty
      interval.
docstr_tok: ["Obtain","the","effect","(","'comparisons","'","or","'slopes","'",")","estimate","and","uncertainty","interval","using","the","posterior","samples",".","First",",","the","posterior","samples","are","subsetted","by","the","variable","of","interest","'s","values",".","Then",",","the","effect","is","computed","for","each","pairwise","combination","of","the","variable","of","interest's","values",".","Parameters","--","--","--","--","--","idata",":","az.InferenceData","InferenceData","object","containing","the","posterior","samples","for","the","model",".","response_transforms",":","dict","Dictionary","with","the","response","variable","name","as","key","and","the","transformation","function","as","value",".","comparison_type",":","str","Type","of","comparison","to","compute",".","Either","'diff","'","or","'ratio","'",".","Defaults","to","'diff","'",".","slope",":","str","Type","of","slope","to","compute",".","Either","'dydx","'",",","'dyex","'",",","'eyex","'",",","'eydx","'",".","Defaults","to","'dydx","'",".","eps",":","float","Value","to","add","to","the","variable","of","interest","'s","values","to","compute","the","slope",".","Defaults","to","None",".","prob",":","float","Probability","for","the","uncertainty","interval",".","Defaults","to","0.94",".","Returns","--","--","--","-","estimate",":","Estimate","Estimate","object","with","the","effect","estimate","mean","and","uncertainty","interval","."]
code: def get_estimate(
      self,
      idata: az.InferenceData,
      response_transforms: dict,
      comparison_type: str = "diff",
      slope: str = "dydx",
      eps: Union[float, None] = None,
      prob: float = 0.94,
  ):
      """Obtain the effect ('comparisons' or 'slopes') estimate and uncertainty
      interval using the posterior samples. First, the posterior samples are
      subsetted by the variable of interest's values. Then, the effect is
      computed for each pairwise combination of the variable of interest's
      values.
  
      Parameters
      ----------
      idata : az.InferenceData
          InferenceData object containing the posterior samples for the model.
      response_transforms : dict
          Dictionary with the response variable name as key and the
          transformation function as value.
      comparison_type : str
          Type of comparison to compute. Either 'diff' or 'ratio'. Defaults
          to 'diff'.
      slope : str
          Type of slope to compute. Either 'dydx', 'dyex', 'eyex', 'eydx'.
          Defaults to 'dydx'.
      eps : float
          Value to add to the variable of interest's values to compute the
          slope. Defaults to None.
      prob : float
          Probability for the uncertainty interval. Defaults to 0.94.
  
      Returns
      -------
      estimate : Estimate
          Estimate object with the effect estimate mean  and uncertainty
          interval.
      """
      assert self.kind in ("slopes", "comparisons")
      assert comparison_type in SUPPORTED_COMPARISONS.keys()
  
      function = SUPPORTED_COMPARISONS[comparison_type]
  
      if self.kind == "slopes":
          self.estimate_name = slope
      else:
          self.estimate_name = comparison_type
  
      if self.variable.values.ndim == 1:
          self.variable.values = np.array(self.variable.values).reshape(
              -1, 1
          )
  
      draws = {}
      variable_data = {}
      for idx, _ in enumerate(self.variable.values):
          mask = np.array(
              self.preds_data[self.variable.name].isin(
                  self.variable.values[idx]
              )
          )
          select_draw = response_transforms(
              idata.posterior[self.response.name_target].sel(
                  {self.response.name_obs: mask}
              )
          )
          select_draw = select_draw.assign_coords(
              {
                  self.response.name_obs: np.arange(
                      len(select_draw.coords[self.response.name_obs])
                  )
              }
          )
          draws[f"mask_{idx}"] = select_draw
  
          if slope in ("eyex", "dyex"):
              variable_data[f"mask_{idx}"] = self.preds_data[
                  self.preds_data[self.variable.name].isin(
                      self.variable.values[idx]
                  )
              ][self.variable.name]
  
      pairwise_variables = self.set_variable_values(draws)
  
      difference_mean = {}
      difference_bounds = {}
      for idx, pair in enumerate(pairwise_variables):
          # comparisons effects
          predictive_difference = function(
              draws[pair[1]], draws[pair[0]]
          )
          # slope effects
          if self.kind == "slopes":
              predictive_difference = self.get_slope_estimate(
                  predictive_difference,
                  pair,
                  draws,
                  slope,
                  eps,
                  variable_data,
              )
  
          difference_mean[
              f"estimate_{idx}"
          ] = predictive_difference.mean(("chain", "draw"))
  
          if self.use_hdi:
              difference_bounds[f"estimate_{idx}"] = az.hdi(
                  predictive_difference, prob
              )
          else:
              difference_bounds[
                  f"estimate_{idx}"
              ] = predictive_difference.quantile(
                  q=(
                      self.response.lower_bound,
                      self.response.upper_bound,
                  ),
                  dim=("chain", "draw"),
              )
  
      self.estimate = Estimate(
          difference_mean, difference_bounds, self.use_hdi
      )
  
      return self
  
imports: from dataclasses import dataclass, field
  import itertools
  from typing import Dict, Union
  import arviz
  import numpy
  import pandas
  from pandas.api.types import is_categorical_dtype, is_string_dtype
  import xarray
  from bambi.models import Model
  from bambi.interpret.create_data import create_differences_data, create_predictions_data
  from bambi.interpret.utils import average_over, ConditionalInfo, enforce_dtypes, identity, merge, VariableInfo
  from bambi.utils import get_aliased_name
label_desc: Use image node_id 3 for calling the PredictiveDifferences obj's underlying member method code with example usage: obj.get_estimate(idata, response_transforms, comparison_type, slope, eps, prob) and returns: self