class_docstr: CatBoost model: https://catboost.ai/
  
  Hyperparameter options: https://catboost.ai/en/docs/references/training-parameters
class_docstr_tok: ["CatBoost","model",":","https",":","\/\/catboost.ai\/","Hyperparameter","options",":","https",":","\/\/catboost.ai\/en\/docs\/references\/training-parameters"]
docstr: Returns the expected peak memory usage in bytes of the CatBoost model during fit.
  
  The memory usage of CatBoost is primarily made up of two sources:
  
  1. The size of the data
  2. The size of the histogram cache
      Scales roughly by 5080*num_features*2^depth bytes
      For 10000 features and 6 depth, the histogram would be 3.2 GB.
docstr_tok: ["Returns","the","expected","peak","memory","usage","in","bytes","of","the","CatBoost","model","during","fit",".","The","memory","usage","of","CatBoost","is","primarily","made","up","of","two","sources",":","1",".","The","size","of","the","data","2",".","The","size","of","the","histogram","cache","Scales","roughly","by","5080","*","num_features","*","2^depth","bytes","For","10000","features","and","6","depth",",","the","histogram","would","be","3.2","GB","."]
code: def _estimate_memory_usage(self, X: pd.DataFrame, **kwargs) -> float:
      """
      Returns the expected peak memory usage in bytes of the CatBoost model during fit.
  
      The memory usage of CatBoost is primarily made up of two sources:
  
      1. The size of the data
      2. The size of the histogram cache
          Scales roughly by 5080*num_features*2^depth bytes
          For 10000 features and 6 depth, the histogram would be 3.2 GB.
      """
      num_classes = (
          self.num_classes if self.num_classes else 1
      )  # self.num_classes could be None after initialization if it's a regression problem
      data_mem_usage = get_approximate_df_mem_usage(X).sum()
      data_mem_usage_bytes = (
          data_mem_usage * 5 + data_mem_usage / 4 * num_classes
      )  # TODO: Extremely crude approximation, can be vastly improved
  
      params = self._get_model_params()
      border_count = params.get("border_count", 254)
      depth = params.get("depth", 6)
      # Formula based on manual testing, aligns with LightGBM histogram sizes
      histogram_mem_usage_bytes = (
          20 * math.pow(2, depth) * len(X.columns) * border_count
      )
      histogram_mem_usage_bytes *= 1.2  # Add a 20% buffer
  
      approx_mem_size_req = (
          data_mem_usage_bytes + histogram_mem_usage_bytes
      )
      return approx_mem_size_req
  
imports: import logging
  import math
  import os
  import time
  import numpy
  import pandas
  from autogluon.common.features.types import R_BOOL, R_CATEGORY, R_FLOAT, R_INT
  from autogluon.common.utils.pandas_utils import get_approximate_df_mem_usage
  from autogluon.common.utils.resource_utils import ResourceManager
  from autogluon.common.utils.try_import import try_import_catboost
  from autogluon.core.constants import MULTICLASS, PROBLEM_TYPES_CLASSIFICATION, QUANTILE, SOFTCLASS
  from autogluon.core.models import AbstractModel
  from autogluon.core.models._utils import get_early_stopping_rounds
  from autogluon.core.utils.exceptions import TimeLimitExceeded
  from .callbacks import EarlyStoppingCallback, MemoryCheckCallback, TimeCheckCallback
  from .catboost_utils import get_catboost_metric_from_ag_metric
  from .hyperparameters.parameters import get_param_baseline
  from .hyperparameters.searchspaces import get_default_searchspace
label_desc: Use image node_id 5 for calling the CatBoostModel obj's underlying member method code with example usage: obj._estimate_memory_usage(X) and returns: approx_mem_size_req