tabular/src/autogluon/tabular/learner/default_learner.py
def _fit(self, X: DataFrame, X_val: DataFrame = None, X_unlabeled: DataFrame = None, holdout_frac=0.1,
             num_bagging_folds=0, num_bagging_sets=1, time_limit=None, save_bagged_folds=True, 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_bagging_folds (int): kfolds used for bagging of models, roughly increases model training time by a factor of k (0: disabled)
                num_bagging_sets (int): number of repeats of kfold bagging to perform (values must be >= 1),
                    total number of models trained during bagging = num_bagging_folds * num_bagging_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}"')
        logger.log(20, f'AutoGluon Version:  {self.version}')
        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])}')
        time_preprocessing_start = time.time()
        logger.log(20, 'Preprocessing data ...')
        X, y, X_val, y_val, X_unlabeled, holdout_frac, num_bagging_folds = self.general_data_processing(X, X_val, X_unlabeled, holdout_frac, num_bagging_folds)
        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,
            feature_metadata=self.feature_generator.feature_metadata,
            low_memory=True,
            k_fold=num_bagging_folds,  # TODO: Consider moving to fit call
            n_repeats=num_bagging_sets,  # TODO: Consider moving to fit call
            save_data=self.cache_data,
            save_bagged_folds=save_bagged_folds,
            random_seed=self.random_seed,
            verbosity=verbosity
        )

        self.trainer_path = trainer.path
        if self.eval_metric is None:
            self.eval_metric = trainer.eval_metric

        self.save()
        trainer.train(X, y, X_val=X_val, y_val=y_val, X_unlabeled=X_unlabeled, holdout_frac=holdout_frac, time_limit=time_limit_trainer, **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 ...')
 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_bagging_folds (int): kfolds used for bagging of models, roughly increases model training time by a factor of k (0: disabled)
                num_bagging_sets (int): number of repeats of kfold bagging to perform (values must be >= 1),
                    total number of models trained during bagging = num_bagging_folds * num_bagging_sets
        
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_bagging_folds (int): kfolds used for bagging of models, roughly increases model training time by a factor of k (0: disabled)
num_bagging_sets (int): number of repeats of kfold bagging to perform (values must be >= 1),
total number of models trained during bagging = num_bagging_folds * num_bagging_sets
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_bagging_folds ( int ) : kfolds used for bagging of models roughly increases model training time by a factor of k ( 0 : disabled ) num_bagging_sets ( int ) : number of repeats of kfold bagging to perform ( values must be > = 1 ) total number of models trained during bagging = num_bagging_folds * num_bagging_sets
def _fit(self, X: DataFrame, X_val: DataFrame = None, X_unlabeled: DataFrame = None, holdout_frac=0.1,
             num_bagging_folds=0, num_bagging_sets=1, time_limit=None, save_bagged_folds=True, verbosity=2, **trainer_fit_kwargs):
        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}"')
        logger.log(20, f'AutoGluon Version:  {self.version}')
        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])}')
        time_preprocessing_start = time.time()
        logger.log(20, 'Preprocessing data ...')
        X, y, X_val, y_val, X_unlabeled, holdout_frac, num_bagging_folds = self.general_data_processing(X, X_val, X_unlabeled, holdout_frac, num_bagging_folds)
        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,
            feature_metadata=self.feature_generator.feature_metadata,
            low_memory=True,
            k_fold=num_bagging_folds,  
            n_repeats=num_bagging_sets,  
            save_data=self.cache_data,
            save_bagged_folds=save_bagged_folds,
            random_seed=self.random_seed,
            verbosity=verbosity
        )
        self.trainer_path = trainer.path
        if self.eval_metric is None:
            self.eval_metric = trainer.eval_metric
        self.save()
        trainer.train(X, y, X_val=X_val, y_val=y_val, X_unlabeled=X_unlabeled, holdout_frac=holdout_frac, time_limit=time_limit_trainer, **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 ...')
def _fit ( self , X : DataFrame , X_val : DataFrame = None , X_unlabeled : DataFrame = None , holdout_frac = 0.1 , num_bagging_folds = 0 , num_bagging_sets = 1 , time_limit = None , save_bagged_folds = True , verbosity = 2 , ** trainer_fit_kwargs ) : 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}"' ) logger . log ( 20 , f'AutoGluon Version:  {self.version}' ) 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])}' ) time_preprocessing_start = time . time ( ) logger . log ( 20 , 'Preprocessing data ...' ) X , y , X_val , y_val , X_unlabeled , holdout_frac , num_bagging_folds = self . general_data_processing ( X , X_val , X_unlabeled , holdout_frac , num_bagging_folds ) 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 , feature_metadata = self . feature_generator . feature_metadata , low_memory = True , k_fold = num_bagging_folds , n_repeats = num_bagging_sets , save_data = self . cache_data , save_bagged_folds = save_bagged_folds , random_seed = self . random_seed , verbosity = verbosity ) self . trainer_path = trainer . path if self . eval_metric is None : self . eval_metric = trainer . eval_metric self . save ( ) trainer . train ( X , y , X_val = X_val , y_val = y_val , X_unlabeled = X_unlabeled , holdout_frac = holdout_frac , time_limit = time_limit_trainer , ** 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 ...' )
Arguments:
X (DataFrame): training data
X_val (DataFrame): data used for hyperparameter tuning.
Arguments : X ( DataFrame ) : training data X_val ( DataFrame ) : data used for hyperparameter tuning .
""" 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_bagging_folds (int): kfolds used for bagging of models, roughly increases model training time by a factor of k (0: disabled)
                num_bagging_sets (int): number of repeats of kfold bagging to perform (values must be >= 1),
                    total number of models trained during bagging = num_bagging_folds * num_bagging_sets
        """ # TODO: if provided, feature_types in X, X_val are ignored right now, need to pass to Learner/trainer and update this documentation. # TODO: Consider moving to fit call # TODO: Consider moving to fit call
self
X
DataFrame
X_val
DataFrame
X_unlabeled
DataFrame
holdout_frac
num_bagging_folds
num_bagging_sets
time_limit
save_bagged_folds
verbosity