docstr: Aggregates the target or prediction variable according to the chosen plot
  type.
  
  This method creates a DataFrame that contains aggregate measures of the target
  variable across different feature buckets (distinct 'x1' and 'x2'
  combinations). The aggregation strategy depends on the selected plot type:
  
  - If the plot type is "interact_target", the target variable is aggregated by
  calculating the mean for each unique pair of feature values ('x1' and 'x2').
  - If the plot type is not "interact_target", the prediction variable is
  aggregated by calculating the median for each unique pair of feature values
  ('x1' and 'x2').
  
  It also determines the count of instances for each unique pair of feature
  values. The resulting DataFrame is saved in `self.summary_df`, while
  `self.plot_df` stores the aggregated results for each unique pair of feature
  values.
  
  This method also updates feature values in `self.summary_df` with their
  corresponding display and percentile values from the `FeatureInfo` objects.
docstr_tok: ["Aggregates","the","target","or","prediction","variable","according","to","the","chosen","plot","type",".","This","method","creates","a","DataFrame","that","contains","aggregate","measures","of","the","target","variable","across","different","feature","buckets","(","distinct","'x1","'","and","'x2'","combinations",")",".","The","aggregation","strategy","depends","on","the","selected","plot","type",":","-","If","the","plot","type","is","``","interact_target","''",",","the","target","variable","is","aggregated","by","calculating","the","mean","for","each","unique","pair","of","feature","values","(","'x1","'","and","'x2","'",")",".","-","If","the","plot","type","is","not","``","interact_target","''",",","the","prediction","variable","is","aggregated","by","calculating","the","median","for","each","unique","pair","of","feature","values","(","'x1","'","and","'x2","'",")",".","It","also","determines","the","count","of","instances","for","each","unique","pair","of","feature","values",".","The","resulting","DataFrame","is","saved","in","`","self.summary_df","`",",","while","`","self.plot_df","`","stores","the","aggregated","results","for","each","unique","pair","of","feature","values",".","This","method","also","updates","feature","values","in","`","self.summary_df","`","with","their","corresponding","display","and","percentile","values","from","the","`","FeatureInfo","`","objects","."]
code: def agg_target(self):
      """
      Aggregates the target or prediction variable according to the chosen plot
      type.
  
      This method creates a DataFrame that contains aggregate measures of the target
      variable across different feature buckets (distinct 'x1' and 'x2'
      combinations). The aggregation strategy depends on the selected plot type:
  
      - If the plot type is "interact_target", the target variable is aggregated by
      calculating the mean for each unique pair of feature values ('x1' and 'x2').
      - If the plot type is not "interact_target", the prediction variable is
      aggregated by calculating the median for each unique pair of feature values
      ('x1' and 'x2').
  
      It also determines the count of instances for each unique pair of feature
      values. The resulting DataFrame is saved in `self.summary_df`, while
      `self.plot_df` stores the aggregated results for each unique pair of feature
      values.
  
      This method also updates feature values in `self.summary_df` with their
      corresponding display and percentile values from the `FeatureInfo` objects.
      """
      self.df["count"] = 1
      target_agg_func = (
          "mean" if self.plot_type == "interact_target" else _q2
      )
      agg_dict = {target: target_agg_func for target in self.target}
      agg_dict["count"] = "count"
      plot_df = self.df.groupby(["x1", "x2"], as_index=False).agg(
          agg_dict
      )
  
      x1_vals = list(
          range(self.df["x1"].min(), self.df["x1"].max() + 1)
      )
      x2_vals = list(
          range(self.df["x2"].min(), self.df["x2"].max() + 1)
      )
      summary_df = pd.DataFrame(
          list(product(x1_vals, x2_vals)), columns=["x1", "x2"]
      )
      summary_df = summary_df.merge(
          plot_df, on=["x1", "x2"], how="left"
      ).fillna(0)
      summary_df[["x1", "x2"]] = summary_df[["x1", "x2"]].astype(int)
  
      info_cols = ["x1", "x2", "value_1", "value_2"]
      for i, feature_info in enumerate(self.feature_infos, start=1):
          summary_df[f"value_{i}"] = summary_df[f"x{i}"].apply(
              lambda x: feature_info.display_columns[x]
          )
          if len(feature_info.percentile_columns):
              summary_df[f"percentile_{i}"] = summary_df[f"x{i}"].apply(
                  lambda x: feature_info.percentile_columns[x]
              )
              info_cols.append(f"percentile_{i}")
  
      self.summary_df = summary_df[info_cols + ["count"] + self.target]
      self.plot_df = plot_df
  
imports: from .info_plot_utils import TargetPlotEngine, PredictPlotEngine, InteractInfoPlotEngine
  from .utils import _make_list, _check_target, _q1, _q2, _q3, FeatureInfo, _check_dataset, _check_model, _calc_preds, _check_classes, _expand_params_for_interact
  import pandas
  from itertools import product
label_desc: Use image node_id 3 for calling the _InteractInfoPlot obj's underlying member method code with example usage: obj.agg_target() without return types