class_docstr: Generates box plots depicting the statistical distribution of prediction values
  across distinct groups (or buckets) of a single feature.
  
  The box plots illustrate the distribution of prediction values, with emphasis
  on the first quartile, median (second quartile), and third quartile, across
  different feature buckets. This visualization provides insights into the
  variation of predicted values with respect to different groups of the chosen
  feature. Such understanding is essential for comprehensive feature analysis
  and aids in interpreting model predictions.
  
  Attributes
  ----------
  df : pd.DataFrame
      A processed DataFrame that includes feature and target (for target plot) or
      predict (for predict plot) columns, feature buckets, along with the count
      of samples within each bucket.
  feature_info : :class:`FeatureInfo`
      An instance of the `FeatureInfo` class.
  feature_cols : list of str
      List of feature columns.
  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.
  n_classes : int
      The number of classes provided, or inferred from the model when it is not
      provided.
  plot_type : str
      The type of the plot to be generated.
  plot_engines : dict
      A dictionary that maps plot types to their plotting engines.
  count_df : pd.DataFrame
      A DataFrame that contains the count as well as the normalized count
      (percentage) of samples within each feature bucket.
  summary_df : pd.DataFrame
      A DataFrame that contains the summary statistics of target (for target
      plot) or predict (for predict plot) values for each feature bucket.
  target_lines : list of pd.DataFrame
      A list of DataFrames, each DataFrame includes aggregate metrics across
      feature buckets for a target (for target plot) or predict (for predict
      plot) variable. For binary and regression problems, the list will contain a
      single DataFrame. For multi-class targets, the list will contain a
      DataFrame for each class.
  
  Methods
  -------
  plot(**kwargs) :
      Generates the plot.
class_docstr_tok: ["Generates","box","plots","depicting","the","statistical","distribution","of","prediction","values","across","distinct","groups","(","or","buckets",")","of","a","single","feature",".","The","box","plots","illustrate","the","distribution","of","prediction","values",",","with","emphasis","on","the","first","quartile",",","median","(","second","quartile",")",",","and","third","quartile",",","across","different","feature","buckets",".","This","visualization","provides","insights","into","the","variation","of","predicted","values","with","respect","to","different","groups","of","the","chosen","feature",".","Such","understanding","is","essential","for","comprehensive","feature","analysis","and","aids","in","interpreting","model","predictions",".","Attributes","--","--","--","--","--","df",":","pd.DataFrame","A","processed","DataFrame","that","includes","feature","and","target","(","for","target","plot",")","or","predict","(","for","predict","plot",")","columns",",","feature","buckets",",","along","with","the","count","of","samples","within","each","bucket",".","feature_info",":",":","class",":","`","FeatureInfo","`","An","instance","of","the","`","FeatureInfo","`","class",".","feature_cols",":","list","of","str","List","of","feature","columns",".","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",".","n_classes",":","int","The","number","of","classes","provided",",","or","inferred","from","the","model","when","it","is","not","provided",".","plot_type",":","str","The","type","of","the","plot","to","be","generated",".","plot_engines",":","dict","A","dictionary","that","maps","plot","types","to","their","plotting","engines",".","count_df",":","pd.DataFrame","A","DataFrame","that","contains","the","count","as","well","as","the","normalized","count","(","percentage",")","of","samples","within","each","feature","bucket",".","summary_df",":","pd.DataFrame","A","DataFrame","that","contains","the","summary","statistics","of","target","(","for","target","plot",")","or","predict","(","for","predict","plot",")","values","for","each","feature","bucket",".","target_lines",":","list","of","pd.DataFrame","A","list","of","DataFrames",",","each","DataFrame","includes","aggregate","metrics","across","feature","buckets","for","a","target","(","for","target","plot",")","or","predict","(","for","predict","plot",")","variable",".","For","binary","and","regression","problems",",","the","list","will","contain","a","single","DataFrame",".","For","multi-class","targets",",","the","list","will","contain","a","DataFrame","for","each","class",".","Methods","--","--","--","-","plot","(","*","*","kwargs",")",":","Generates","the","plot","."]
docstr: Initialize a `PredictPlot` instance.
  
  Parameters
  ----------
  df : pd.DataFrame
      A DataFrame that at least contains columns specified by `model_features`.
  feature : str or list of str
      The column name(s) of the chosen feature. It is a list of str when the
      chosen feature is one-hot encoded.
  feature_name : str
      A custom name for the chosen feature.
  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`.
  model_features : list of str
      A list of features used in model prediction.
  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.
  predict_kwds : dict, optional
      Additional keyword arguments to pass to the `model`'s predict function.
      Default is None.
  chunk_size : int, optional
      The number of samples to predict at each iteration. -1 means all samples at
      once. Default is -1.
  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.
  grid_type : {'percentile', 'equal'}, optional
      The grid type. Only applicable for numeric feature. Default is percentile.
  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.
  percentile_range : tuple, optional
      A tuple of two values indicating the range of percentiles to use. Only
      applicable for numeric feature and when `grid_type` is 'percentile'. If it
      is None, will use all samples. Default is None.
  grid_range : tuple, optional
      A tuple of two values indicating the range of grid values to use. Only
      applicable for numeric feature. If it is None, will use all samples.
      Default is None.
  show_outliers : bool or list of bool, optional
      Whether to show outliers in the plot. Only applicable for numeric feature.
      For interact plot, it can also be a list of two booleans, indicating
      whether to show outliers for each feature. Default is False.
  endpoint : bool, optional
      Whether to include the endpoint of the range. Default is True.
docstr_tok: ["Initialize","a","`","PredictPlot","`","instance",".","Parameters","--","--","--","--","--","df",":","pd.DataFrame","A","DataFrame","that","at","least","contains","columns","specified","by","`","model_features","`",".","feature",":","str","or","list","of","str","The","column","name","(","s",")","of","the","chosen","feature",".","It","is","a","list","of","str","when","the","chosen","feature","is","one-hot","encoded",".","feature_name",":","str","A","custom","name","for","the","chosen","feature",".","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","`",".","model_features",":","list","of","str","A","list","of","features","used","in","model","prediction",".","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",".","predict_kwds",":","dict",",","optional","Additional","keyword","arguments","to","pass","to","the","`","model","`","'s","predict","function",".","Default","is","None",".","chunk_size",":","int",",","optional","The","number","of","samples","to","predict","at","each","iteration",".","-1","means","all","samples","at","once",".","Default","is","-1.","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",".","grid_type",":","{","'percentile","'",",","'equal","'","}",",","optional","The","grid","type",".","Only","applicable","for","numeric","feature",".","Default","is","percentile",".","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.","percentile_range",":","tuple",",","optional","A","tuple","of","two","values","indicating","the","range","of","percentiles","to","use",".","Only","applicable","for","numeric","feature","and","when","`","grid_type","`","is","'percentile","'",".","If","it","is","None",",","will","use","all","samples",".","Default","is","None",".","grid_range",":","tuple",",","optional","A","tuple","of","two","values","indicating","the","range","of","grid","values","to","use",".","Only","applicable","for","numeric","feature",".","If","it","is","None",",","will","use","all","samples",".","Default","is","None",".","show_outliers",":","bool","or","list","of","bool",",","optional","Whether","to","show","outliers","in","the","plot",".","Only","applicable","for","numeric","feature",".","For","interact","plot",",","it","can","also","be","a","list","of","two","booleans",",","indicating","whether","to","show","outliers","for","each","feature",".","Default","is","False",".","endpoint",":","bool",",","optional","Whether","to","include","the","endpoint","of","the","range",".","Default","is","True","."]
code: def __init__(
      self,
      df,
      feature,
      feature_name,
      model,
      model_features,
      pred_func=None,
      n_classes=None,
      predict_kwds=None,
      chunk_size=-1,
      cust_grid_points=None,
      grid_type="percentile",
      num_grid_points=10,
      percentile_range=None,
      grid_range=None,
      show_outliers=False,
      endpoint=True,
  ):
      """
      Initialize a `PredictPlot` instance.
  
      Parameters
      ----------
      df : pd.DataFrame
          A DataFrame that at least contains columns specified by `model_features`.
      feature : str or list of str
          The column name(s) of the chosen feature. It is a list of str when the
          chosen feature is one-hot encoded.
      feature_name : str
          A custom name for the chosen feature.
      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`.
      model_features : list of str
          A list of features used in model prediction.
      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.
      predict_kwds : dict, optional
          Additional keyword arguments to pass to the `model`'s predict function.
          Default is None.
      chunk_size : int, optional
          The number of samples to predict at each iteration. -1 means all samples at
          once. Default is -1.
      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.
      grid_type : {'percentile', 'equal'}, optional
          The grid type. Only applicable for numeric feature. Default is percentile.
      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.
      percentile_range : tuple, optional
          A tuple of two values indicating the range of percentiles to use. Only
          applicable for numeric feature and when `grid_type` is 'percentile'. If it
          is None, will use all samples. Default is None.
      grid_range : tuple, optional
          A tuple of two values indicating the range of grid values to use. Only
          applicable for numeric feature. If it is None, will use all samples.
          Default is None.
      show_outliers : bool or list of bool, optional
          Whether to show outliers in the plot. Only applicable for numeric feature.
          For interact plot, it can also be a list of two booleans, indicating
          whether to show outliers for each feature. Default is False.
      endpoint : bool, optional
          Whether to include the endpoint of the range. Default is True.
      """
      super().__init__(
          df,
          feature,
          feature_name,
          None,
          model,
          model_features,
          pred_func,
          n_classes,
          predict_kwds,
          chunk_size,
          plot_type="predict",
          cust_grid_points=cust_grid_points,
          grid_type=grid_type,
          num_grid_points=num_grid_points,
          percentile_range=percentile_range,
          grid_range=grid_range,
          show_outliers=show_outliers,
          endpoint=endpoint,
      )
  
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 1 to create a new PredictPlot object from inherited base classes: _InfoPlot with example: obj = PredictPlot(df, feature, feature_name, model, model_features, pred_func, n_classes, predict_kwds, chunk_size, cust_grid_points, grid_type, num_grid_points, percentile_range, grid_range, show_outliers, endpoint)