class_docstr: Performs Partial Dependence Plot (PDP) analysis for interaction between two features.
  
  Attributes
  ----------
  model : object
      A trained model object. The model should have a `predict` or
      `predict_proba` method. Otherwise a custom prediction function should be
      provided through `pred_func`.
  n_classes : int
      Number of classes. If it is None, will infer from `model.n_classes_`.
      Please set it as 0 for regression.
  pred_func : callable
      A custom prediction function. If not provided, `predict` or `predict_proba`
      method of `model` is used to generate the predictions.
  model_features : list of str
      A list of features used in model prediction.
  memory_limit : float
      The maximum proportion of memory that can be used by the calculation
      process.
  chunk_size : int
      The number of samples to predict at each iteration. -1 means all samples at
      once.
  n_jobs : int
      The number of jobs to run in parallel for computation. If set to -1, all
      CPUs are used.
  predict_kwds : dict
      Additional keyword arguments to pass to the `model`'s predict function.
  data_transformer : callable
      A function to transform the input data before prediction.
  dist_num_samples : int
      The number of samples to use for estimating the distribution of the data.
      This is used to handle large datasets by sampling a smaller subset for
      efficiency.
  plot_type : str
      The type of the plot to be generated.
  features : list
      List of column name(s) for the 2 chosen features. The length of the list
      should be strictly 2.
  feature_names : list
      List of custom names for the 2 chosen features. The length of the list
      should be strictly 2.
  pdp_isolate_objs : list of :class:`PDPIsolate`
      A list of `PDPIsolate` objects, for two features.
  n_grids : int
      The number of feature grids. For interact plot, it is the product of
      `n_grids` of two features.
  feature_grid_combos : numpy.ndarray
      A 2D array that contains the combinations of feature grids. The shape of
      the array is (n_grids, ...).
  from_model : bool
      A flag indicating if the prediction function was obtained from the model or
      was provided as input.
  target : list of int
      List of target indices. For binary and regression problems, the list will
      be just [0]. For multi-class targets, the list is the class indices.
  results : list of :class:`PDResults`
      The results of the Partial Dependence Plot (PDP) analysis. For binary and
      regression problems, the list will contain a single `PDResults` object. For
      multi-class targets, the list will contain a `PDResults` object for each
      class.
  
  Methods
  -------
  plot(**kwargs) :
      Generates the PDP plot.
class_docstr_tok: ["Performs","Partial","Dependence","Plot","(","PDP",")","analysis","for","interaction","between","two","features",".","Attributes","--","--","--","--","--","model",":","object","A","trained","model","object",".","The","model","should","have","a","`","predict","`","or","`","predict_proba","`","method",".","Otherwise","a","custom","prediction","function","should","be","provided","through","`","pred_func","`",".","n_classes",":","int","Number","of","classes",".","If","it","is","None",",","will","infer","from","`","model.n_classes_","`",".","Please","set","it","as","0","for","regression",".","pred_func",":","callable","A","custom","prediction","function",".","If","not","provided",",","`","predict","`","or","`","predict_proba","`","method","of","`","model","`","is","used","to","generate","the","predictions",".","model_features",":","list","of","str","A","list","of","features","used","in","model","prediction",".","memory_limit",":","float","The","maximum","proportion","of","memory","that","can","be","used","by","the","calculation","process",".","chunk_size",":","int","The","number","of","samples","to","predict","at","each","iteration",".","-1","means","all","samples","at","once",".","n_jobs",":","int","The","number","of","jobs","to","run","in","parallel","for","computation",".","If","set","to","-1",",","all","CPUs","are","used",".","predict_kwds",":","dict","Additional","keyword","arguments","to","pass","to","the","`","model","`","'s","predict","function",".","data_transformer",":","callable","A","function","to","transform","the","input","data","before","prediction",".","dist_num_samples",":","int","The","number","of","samples","to","use","for","estimating","the","distribution","of","the","data",".","This","is","used","to","handle","large","datasets","by","sampling","a","smaller","subset","for","efficiency",".","plot_type",":","str","The","type","of","the","plot","to","be","generated",".","features",":","list","List","of","column","name","(","s",")","for","the","2","chosen","features",".","The","length","of","the","list","should","be","strictly","2.","feature_names",":","list","List","of","custom","names","for","the","2","chosen","features",".","The","length","of","the","list","should","be","strictly","2.","pdp_isolate_objs",":","list","of",":","class",":","`","PDPIsolate","`","A","list","of","`","PDPIsolate","`","objects",",","for","two","features",".","n_grids",":","int","The","number","of","feature","grids",".","For","interact","plot",",","it","is","the","product","of","`","n_grids","`","of","two","features",".","feature_grid_combos",":","numpy.ndarray","A","2D","array","that","contains","the","combinations","of","feature","grids",".","The","shape","of","the","array","is","(","n_grids",",","...",")",".","from_model",":","bool","A","flag","indicating","if","the","prediction","function","was","obtained","from","the","model","or","was","provided","as","input",".","target",":","list","of","int","List","of","target","indices",".","For","binary","and","regression","problems",",","the","list","will","be","just","[","0","]",".","For","multi-class","targets",",","the","list","is","the","class","indices",".","results",":","list","of",":","class",":","`","PDResults","`","The","results","of","the","Partial","Dependence","Plot","(","PDP",")","analysis",".","For","binary","and","regression","problems",",","the","list","will","contain","a","single","`","PDResults","`","object",".","For","multi-class","targets",",","the","list","will","contain","a","`","PDResults","`","object","for","each","class",".","Methods","--","--","--","-","plot","(","*","*","kwargs",")",":","Generates","the","PDP","plot","."]
docstr: Initializes a `PDPInteract` instance.
  
  Parameters
  ----------
  model : object
      A trained model object. The model should have a `predict` or
      `predict_proba` method. Otherwise a custom prediction function should be
      provided through `pred_func`.
  df : pd.DataFrame
      A DataFrame that at least contains columns specified by `model_features`.
  model_features : list of str
      A list of features used in model prediction.
  features : list
      List of column name(s) for the 2 chosen features. The length of the list
      should be strictly 2.
  feature_names : list
      List of custom names for the 2 chosen features. The length of the list
      should be strictly 2.
  pred_func : callable, optional
      A custom prediction function. If not provided, `predict` or `predict_proba`
      method of `model` is used to generate the predictions. Default is None.
  n_classes : int, optional
      Number of classes. If it is None, will infer from `model.n_classes_`.
      Please set it as 0 for regression. Default is None.
  memory_limit : float, optional
      The maximum proportion of memory that can be used by the calculation
      process. Default is 0.5.
  chunk_size : int, optional
      The number of samples to predict at each iteration. -1 means all samples at
      once. Default is -1.
  n_jobs : int, optional
      The number of jobs to run in parallel for computation. If set to -1, all
      CPUs are used. Default is 1.
  predict_kwds : dict, optional
      Additional keyword arguments to pass to the `model`'s predict function.
      Default is None.
  data_transformer : callable, optional
      A function to transform the input data before prediction. Default is None.
  num_grid_points : int or list of int, optional
      The number of grid points to use. Only applicable for numeric feature. For
      interact plot, it can also be a list of two integers, indicating the number
      of grid points for each feature. Default is 10.
  grid_types : str or list of str, optional
      Same as `grid_type`, but could be a list of two strings, indicating the
      grid type for each feature. Default is percentile.
  percentile_ranges : tuple or a list of tuples, optional
      Same as `percentile_range`, but could be a list of two tuples, indicating
      the percentile range for each feature. Default is None.
  grid_ranges : tuple or list of tuples, optional
      Same as `grid_range`, but could be a list of two tuples, indicating the
      grid range for each feature. Default is None.
  cust_grid_points : array-like or list of arrays, optional
      Custom grid points for the feature. For interact plot, it can also be a
      list of two arrays, indicating the grid points for each feature. Default is
      None.
docstr_tok: ["Initializes","a","`","PDPInteract","`","instance",".","Parameters","--","--","--","--","--","model",":","object","A","trained","model","object",".","The","model","should","have","a","`","predict","`","or","`","predict_proba","`","method",".","Otherwise","a","custom","prediction","function","should","be","provided","through","`","pred_func","`",".","df",":","pd.DataFrame","A","DataFrame","that","at","least","contains","columns","specified","by","`","model_features","`",".","model_features",":","list","of","str","A","list","of","features","used","in","model","prediction",".","features",":","list","List","of","column","name","(","s",")","for","the","2","chosen","features",".","The","length","of","the","list","should","be","strictly","2.","feature_names",":","list","List","of","custom","names","for","the","2","chosen","features",".","The","length","of","the","list","should","be","strictly","2.","pred_func",":","callable",",","optional","A","custom","prediction","function",".","If","not","provided",",","`","predict","`","or","`","predict_proba","`","method","of","`","model","`","is","used","to","generate","the","predictions",".","Default","is","None",".","n_classes",":","int",",","optional","Number","of","classes",".","If","it","is","None",",","will","infer","from","`","model.n_classes_","`",".","Please","set","it","as","0","for","regression",".","Default","is","None",".","memory_limit",":","float",",","optional","The","maximum","proportion","of","memory","that","can","be","used","by","the","calculation","process",".","Default","is","0.5.","chunk_size",":","int",",","optional","The","number","of","samples","to","predict","at","each","iteration",".","-1","means","all","samples","at","once",".","Default","is","-1.","n_jobs",":","int",",","optional","The","number","of","jobs","to","run","in","parallel","for","computation",".","If","set","to","-1",",","all","CPUs","are","used",".","Default","is","1.","predict_kwds",":","dict",",","optional","Additional","keyword","arguments","to","pass","to","the","`","model","`","'s","predict","function",".","Default","is","None",".","data_transformer",":","callable",",","optional","A","function","to","transform","the","input","data","before","prediction",".","Default","is","None",".","num_grid_points",":","int","or","list","of","int",",","optional","The","number","of","grid","points","to","use",".","Only","applicable","for","numeric","feature",".","For","interact","plot",",","it","can","also","be","a","list","of","two","integers",",","indicating","the","number","of","grid","points","for","each","feature",".","Default","is","10.","grid_types",":","str","or","list","of","str",",","optional","Same","as","`","grid_type","`",",","but","could","be","a","list","of","two","strings",",","indicating","the","grid","type","for","each","feature",".","Default","is","percentile",".","percentile_ranges",":","tuple","or","a","list","of","tuples",",","optional","Same","as","`","percentile_range","`",",","but","could","be","a","list","of","two","tuples",",","indicating","the","percentile","range","for","each","feature",".","Default","is","None",".","grid_ranges",":","tuple","or","list","of","tuples",",","optional","Same","as","`","grid_range","`",",","but","could","be","a","list","of","two","tuples",",","indicating","the","grid","range","for","each","feature",".","Default","is","None",".","cust_grid_points",":","array-like","or","list","of","arrays",",","optional","Custom","grid","points","for","the","feature",".","For","interact","plot",",","it","can","also","be","a","list","of","two","arrays",",","indicating","the","grid","points","for","each","feature",".","Default","is","None","."]
code: def __init__(
      self,
      model,
      df,
      model_features,
      features,
      feature_names,
      pred_func=None,
      n_classes=None,
      memory_limit=0.5,
      chunk_size=-1,
      n_jobs=1,
      predict_kwds=None,
      data_transformer=None,
      num_grid_points=10,
      grid_types="percentile",
      percentile_ranges=None,
      grid_ranges=None,
      cust_grid_points=None,
  ):
      """
      Initializes a `PDPInteract` instance.
  
      Parameters
      ----------
      model : object
          A trained model object. The model should have a `predict` or
          `predict_proba` method. Otherwise a custom prediction function should be
          provided through `pred_func`.
      df : pd.DataFrame
          A DataFrame that at least contains columns specified by `model_features`.
      model_features : list of str
          A list of features used in model prediction.
      features : list
          List of column name(s) for the 2 chosen features. The length of the list
          should be strictly 2.
      feature_names : list
          List of custom names for the 2 chosen features. The length of the list
          should be strictly 2.
      pred_func : callable, optional
          A custom prediction function. If not provided, `predict` or `predict_proba`
          method of `model` is used to generate the predictions. Default is None.
      n_classes : int, optional
          Number of classes. If it is None, will infer from `model.n_classes_`.
          Please set it as 0 for regression. Default is None.
      memory_limit : float, optional
          The maximum proportion of memory that can be used by the calculation
          process. Default is 0.5.
      chunk_size : int, optional
          The number of samples to predict at each iteration. -1 means all samples at
          once. Default is -1.
      n_jobs : int, optional
          The number of jobs to run in parallel for computation. If set to -1, all
          CPUs are used. Default is 1.
      predict_kwds : dict, optional
          Additional keyword arguments to pass to the `model`'s predict function.
          Default is None.
      data_transformer : callable, optional
          A function to transform the input data before prediction. Default is None.
      num_grid_points : int or list of int, optional
          The number of grid points to use. Only applicable for numeric feature. For
          interact plot, it can also be a list of two integers, indicating the number
          of grid points for each feature. Default is 10.
      grid_types : str or list of str, optional
          Same as `grid_type`, but could be a list of two strings, indicating the
          grid type for each feature. Default is percentile.
      percentile_ranges : tuple or a list of tuples, optional
          Same as `percentile_range`, but could be a list of two tuples, indicating
          the percentile range for each feature. Default is None.
      grid_ranges : tuple or list of tuples, optional
          Same as `grid_range`, but could be a list of two tuples, indicating the
          grid range for each feature. Default is None.
      cust_grid_points : array-like or list of arrays, optional
          Custom grid points for the feature. For interact plot, it can also be a
          list of two arrays, indicating the grid points for each feature. Default is
          None.
      """
      super().__init__(
          model,
          model_features,
          pred_func,
          n_classes,
          memory_limit,
          chunk_size,
          n_jobs,
          predict_kwds,
          data_transformer,
      )
      self.plot_type = "pdp_interact"
      _check_dataset(df)
      self.df = df
      self.model_features = model_features
      self.features = features
      self.feature_names = feature_names
      kwargs = {
          "num_grid_points": num_grid_points,
          "grid_types": grid_types,
          "percentile_ranges": percentile_ranges,
          "grid_ranges": grid_ranges,
          "cust_grid_points": cust_grid_points,
      }
      self._prepare_feature(kwargs)
      self._prepare_calculate()
      self._calculate()
  
imports: from .pdp_utils import PDPIsolatePlotEngine, PDPInteractPlotEngine
  from .utils import _check_frac_to_plot, _make_list, _check_classes, _calc_n_jobs, FeatureInfo, _check_model, _calc_preds, _expand_params_for_interact, _check_dataset, _check_cluster_params, _check_plot_engine, _check_pdp_interact_plot_type
  import pandas
  import numpy
  from pqdm.processes import pqdm
  from tqdm.auto import tqdm
  import warnings
label_desc: Use image node_id 1 to create a new PDPInteract object from inherited base classes: _PDPBase with example: obj = PDPInteract(model, df, model_features, features, feature_names, pred_func, n_classes, memory_limit, chunk_size, n_jobs, predict_kwds, data_transformer, num_grid_points, grid_types, percentile_ranges, grid_ranges, cust_grid_points)