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: Calculates the grid points for numeric features based on the `grid_type`
  attribute and other class attributes. Return the grid points and percentiles
  corresponding to each grid point (or None if not applicable).
docstr_tok: ["Calculates","the","grid","points","for","numeric","features","based","on","the","`","grid_type","`","attribute","and","other","class","attributes",".","Return","the","grid","points","and","percentiles","corresponding","to","each","grid","point","(","or","None","if","not","applicable",")","."]
code: def _get_numeric_grids(self, values):
      """
      Calculates the grid points for numeric features based on the `grid_type`
      attribute and other class attributes. Return the grid points and percentiles
      corresponding to each grid point (or None if not applicable).
      """
      if self.grid_type == "percentile":
          start, end = self.percentile_range or (0, 100)
          percentiles = np.linspace(
              start=start, stop=end, num=self.num_grid_points
          )
          grids_df = (
              pd.DataFrame(
                  {
                      "percentiles": [round(x, 2) for x in percentiles],
                      "grids": np.percentile(values, percentiles),
                  }
              )
              .groupby(["grids"], as_index=False)
              .agg({"percentiles": list})
              .sort_values("grids", ascending=True)
          )
          return (
              grids_df["grids"].values,
              grids_df["percentiles"].values,
          )
      else:
          min_value, max_value = self.grid_range or (
              np.min(values),
              np.max(values),
          )
          return (
              np.linspace(min_value, max_value, self.num_grid_points),
              None,
          )
  
imports: import numpy
  import pandas
  import psutil
label_desc: Use image node_id 5 for calling the FeatureInfo obj's underlying member method code with example usage: obj._get_numeric_grids(values) and returns: grids_df,  grids_df, np,  None