class_docstr: A class to store information about a feature, preprocess the data, and
  prepare summary statistics.
  
  Attributes
  ----------
  col_name : str or list of str
      The column name(s) of the feature in the input DataFrame.
  name : str
      The custom name of the feature.
  type : str
      The type of the feature, as determined by the _check_col function.
  cust_grid_points : array-like or list of arrays
      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.
  grid_type : {'percentile', 'equal'}
      The grid type. Only applicable for numeric feature.
  num_grid_points : int or list of int
      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.
  percentile_range : tuple
      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.
  grid_range : tuple
      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.
  show_outliers : bool or list of bool
      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.
  endpoint : bool
      Whether to include the endpoint of the range.
  
  Methods
  -------
  prepare(**kwargs)
      Prepares the input DataFrame and calculates summary statistics.
class_docstr_tok: ["A","class","to","store","information","about","a","feature",",","preprocess","the","data",",","and","prepare","summary","statistics",".","Attributes","--","--","--","--","--","col_name",":","str","or","list","of","str","The","column","name","(","s",")","of","the","feature","in","the","input","DataFrame",".","name",":","str","The","custom","name","of","the","feature",".","type",":","str","The","type","of","the","feature",",","as","determined","by","the","_check_col","function",".","cust_grid_points",":","array-like","or","list","of","arrays","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",".","grid_type",":","{","'percentile","'",",","'equal","'","}","The","grid","type",".","Only","applicable","for","numeric","feature",".","num_grid_points",":","int","or","list","of","int","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",".","percentile_range",":","tuple","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",".","grid_range",":","tuple","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",".","show_outliers",":","bool","or","list","of","bool","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",".","endpoint",":","bool","Whether","to","include","the","endpoint","of","the","range",".","Methods","--","--","--","-","prepare","(","*","*","kwargs",")","Prepares","the","input","DataFrame","and","calculates","summary","statistics","."]
docstr: Initializes the `FeatureInfo` class.
  
  Parameters
  ----------
  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.
  df : pd.DataFrame
      A DataFrame that at least contains the feature(s).
  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: ["Initializes","the","`","FeatureInfo","`","class",".","Parameters","--","--","--","--","--","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",".","df",":","pd.DataFrame","A","DataFrame","that","at","least","contains","the","feature","(","s",")",".","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,
      feature,
      feature_name,
      df,
      cust_grid_points=None,
      grid_type="percentile",
      num_grid_points=10,
      percentile_range=None,
      grid_range=None,
      show_outliers=False,
      endpoint=True,
  ):
      """
      Initializes the `FeatureInfo` class.
  
      Parameters
      ----------
      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.
      df : pd.DataFrame
          A DataFrame that at least contains the feature(s).
      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.
      """
      self.col_name = feature
      self.name = feature_name
      self.type = _check_col(self.col_name, df, is_target=False)
      self.cust_grid_points = cust_grid_points
      self.grid_type = grid_type
      self.num_grid_points = num_grid_points
      self.percentile_range = percentile_range
      self.grid_range = grid_range
      self.show_outliers = show_outliers
      self.endpoint = endpoint
  
      self._check_grid_type()
      self._check_range()
  
      if all(
          v is None
          for v in [
              self.percentile_range,
              self.grid_range,
              self.cust_grid_points,
          ]
      ):
          self.show_outliers = False
  
imports: import numpy
  import pandas
  import psutil
label_desc: Use image node_id 1 to create a new FeatureInfo object  with example: obj = FeatureInfo(feature, feature_name, df, cust_grid_points, grid_type, num_grid_points, percentile_range, grid_range, show_outliers, endpoint)