docstr: Arguments:
  X (DataFrame): training data
  X_val (DataFrame): data used for hyperparameter tuning. Note: final model may be trained using this data as well as training data
  X_unlabeled (DataFrame): data used for pretraining a model. This is same data format as X, without label-column. This data is used for semi-supervised learning.
  holdout_frac (float): Fraction of data to hold out for evaluating validation performance (ignored if X_val != None, ignored if kfolds != 0)
  num_bag_folds (int): kfolds used for bagging of models, roughly increases model training time by a factor of k (0: disabled)
  num_bag_sets (int): number of repeats of kfold bagging to perform (values must be >= 1),
      total number of models trained during bagging = num_bag_folds * num_bag_sets
docstr_tok: ["Arguments",":","X","(","DataFrame",")",":","training","data","X_val","(","DataFrame",")",":","data","used","for","hyperparameter","tuning",".","Note",":","final","model","may","be","trained","using","this","data","as","well","as","training","data","X_unlabeled","(","DataFrame",")",":","data","used","for","pretraining","a","model",".","This","is","same","data","format","as","X",",","without","label-column",".","This","data","is","used","for","semi-supervised","learning",".","holdout_frac","(","float",")",":","Fraction","of","data","to","hold","out","for","evaluating","validation","performance","(","ignored","if","X_val","!","=","None",",","ignored","if","kfolds","!","=","0",")","num_bag_folds","(","int",")",":","kfolds","used","for","bagging","of","models",",","roughly","increases","model","training","time","by","a","factor","of","k","(","0",":","disabled",")","num_bag_sets","(","int",")",":","number","of","repeats","of","kfold","bagging","to","perform","(","values","must","be",">","=","1",")",",","total","number","of","models","trained","during","bagging","=","num_bag_folds","*","num_bag_sets"]
code: def _fit(
      self,
      X: DataFrame,
      X_val: DataFrame = None,
      X_unlabeled: DataFrame = None,
      holdout_frac=0.1,
      num_bag_folds=0,
      num_bag_sets=1,
      time_limit=None,
      infer_limit=None,
      infer_limit_batch_size=None,
      verbosity=2,
      **trainer_fit_kwargs,
  ):
      """Arguments:
      X (DataFrame): training data
      X_val (DataFrame): data used for hyperparameter tuning. Note: final model may be trained using this data as well as training data
      X_unlabeled (DataFrame): data used for pretraining a model. This is same data format as X, without label-column. This data is used for semi-supervised learning.
      holdout_frac (float): Fraction of data to hold out for evaluating validation performance (ignored if X_val != None, ignored if kfolds != 0)
      num_bag_folds (int): kfolds used for bagging of models, roughly increases model training time by a factor of k (0: disabled)
      num_bag_sets (int): number of repeats of kfold bagging to perform (values must be >= 1),
          total number of models trained during bagging = num_bag_folds * num_bag_sets
      """
      # TODO: if provided, feature_types in X, X_val are ignored right now, need to pass to Learner/trainer and update this documentation.
      self._time_limit = time_limit
      if time_limit:
          logger.log(
              20,
              f"Beginning AutoGluon training ... Time limit = {time_limit}s",
          )
      else:
          logger.log(20, "Beginning AutoGluon training ...")
      logger.log(20, f'AutoGluon will save models to "{self.path}"')
      include_gpu_count = False
      if verbosity >= 3:
          include_gpu_count = True
      msg = get_ag_system_info(
          path=self.path, include_gpu_count=include_gpu_count
      )
      logger.log(20, msg)
      logger.log(20, f"Train Data Rows:    {len(X)}")
      logger.log(
          20,
          f"Train Data Columns: {len([column for column in X.columns if column != self.label])}",
      )
      if X_val is not None:
          logger.log(20, f"Tuning Data Rows:    {len(X_val)}")
          logger.log(
              20,
              f"Tuning Data Columns: {len([column for column in X_val.columns if column != self.label])}",
          )
      logger.log(20, f"Label Column:       {self.label}")
      time_preprocessing_start = time.time()
      self._pre_X_rows = len(X)
      if self.problem_type is None:
          self.problem_type = self.infer_problem_type(y=X[self.label])
      logger.log(20, f"Problem Type:       {self.problem_type}")
      if self.groups is not None:
          num_bag_sets = 1
          num_bag_folds = len(X[self.groups].unique())
      X_og = None if infer_limit_batch_size is None else X
      logger.log(20, "Preprocessing data ...")
      (
          X,
          y,
          X_val,
          y_val,
          X_unlabeled,
          holdout_frac,
          num_bag_folds,
          groups,
      ) = self.general_data_processing(
          X, X_val, X_unlabeled, holdout_frac, num_bag_folds
      )
      if X_og is not None:
          infer_limit = self._update_infer_limit(
              X=X_og,
              infer_limit_batch_size=infer_limit_batch_size,
              infer_limit=infer_limit,
          )
  
      self._post_X_rows = len(X)
      time_preprocessing_end = time.time()
      self._time_fit_preprocessing = (
          time_preprocessing_end - time_preprocessing_start
      )
      logger.log(
          20,
          f"Data preprocessing and feature engineering runtime = {round(self._time_fit_preprocessing, 2)}s ...",
      )
      if time_limit:
          time_limit_trainer = time_limit - self._time_fit_preprocessing
      else:
          time_limit_trainer = None
  
      trainer = self.trainer_type(
          path=self.model_context,
          problem_type=self.label_cleaner.problem_type_transform,
          eval_metric=self.eval_metric,
          num_classes=self.label_cleaner.num_classes,
          quantile_levels=self.quantile_levels,
          feature_metadata=self.feature_generator.feature_metadata,
          low_memory=True,
          k_fold=num_bag_folds,  # TODO: Consider moving to fit call
          n_repeats=num_bag_sets,  # TODO: Consider moving to fit call
          sample_weight=self.sample_weight,
          weight_evaluation=self.weight_evaluation,
          save_data=self.cache_data,
          random_state=self.random_state,
          verbosity=verbosity,
      )
  
      self.trainer_path = trainer.path
      if self.eval_metric is None:
          self.eval_metric = trainer.eval_metric
  
      self.save()
      trainer.fit(
          X=X,
          y=y,
          X_val=X_val,
          y_val=y_val,
          X_unlabeled=X_unlabeled,
          holdout_frac=holdout_frac,
          time_limit=time_limit_trainer,
          infer_limit=infer_limit,
          infer_limit_batch_size=infer_limit_batch_size,
          groups=groups,
          **trainer_fit_kwargs,
      )
      self.save_trainer(trainer=trainer)
      time_end = time.time()
      self._time_fit_training = time_end - time_preprocessing_end
      self._time_fit_total = time_end - time_preprocessing_start
      logger.log(
          20,
          f'AutoGluon training complete, total runtime = {round(self._time_fit_total, 2)}s ... Best model: "{trainer.model_best}"',
      )
  
imports: import copy
  import logging
  import math
  import time
  import numpy
  import pandas
  from pandas import DataFrame
  from autogluon.common.utils.log_utils import convert_time_in_s_to_log_friendly
  from autogluon.common.utils.system_info import get_ag_system_info
  from autogluon.core.constants import AUTO_WEIGHT, BALANCE_WEIGHT, BINARY, MULTICLASS, QUANTILE, REGRESSION
  from autogluon.core.data import LabelCleaner
  from autogluon.core.data.cleaner import Cleaner
  from autogluon.core.utils.time import sample_df_for_time_func, time_func
  from autogluon.core.utils.utils import augment_rare_classes, extract_column
  from ..trainer import AutoTrainer
  from .abstract_learner import AbstractTabularLearner
label_desc: Use image node_id 2 for calling the DefaultLearner obj's underlying member method code with example usage: obj._fit(X, X_val, X_unlabeled, holdout_frac, num_bag_folds, num_bag_sets, time_limit, infer_limit, infer_limit_batch_size, verbosity) without return types