build/lib/AutoMxL/__main__.py
def model_train(self, clf='XGBOOST', grid_param=None, top_bagging=False, n_comb=10, comb_seed=None, verbose=False):
        """train models with random search

        - creates models with random hyper-parameters combinations from HP grid
        - fits models on self

        Notes :

        - Available classifiers : Random Forest, XGBOOST
        - can enable bagging algo with top_bagging parameter

        Parameters
        ----------
        clf : string (Default : 'XGBOOST')
            classifier used for modelisation
        grid_param : dict
            random search grid {Hyperparameter name : values list}
        top_bagging : boolean (Default : False)
            enable Bagging
        n_comb : int (Default : 10)
            HP combination number
        comb_seed : int (Default : None)
            random combination seed
        verbose : boolean (Default False)
            Get logging information

        """
        assert self.step in ['preprocess', 'features_selection'], 'apply preprocess method'

        df_train = self.copy()
        target = self.target


        if verbose:
            start_time = time()
            print_title1('Train Models')

        # instantiate Hyperopt object
        hyperopt = HyperOpt(classifier=clf, grid_param=grid_param, n_param_comb=n_comb,
                            bagging=top_bagging, comb_seed=comb_seed)

        # fit model on train set
        if verbose:
            color_print('training models')

        # fit hyperopt on self
        hyperopt.fit(df_train, self.target, verbose=verbose)

        self.d_hyperopt = hyperopt
        self.is_fitted_model = True
        self.target = target
        self.step = 'train_model'

        if verbose:
            print('\n\t\t>>>', 'model_train execution time:', round(time() - start_time, 4), 'secs. <<<')
train models with random search

        - creates models with random hyper-parameters combinations from HP grid
        - fits models on self

        Notes :

        - Available classifiers : Random Forest, XGBOOST
        - can enable bagging algo with top_bagging parameter

        Parameters
        ----------
        clf : string (Default : 'XGBOOST')
            classifier used for modelisation
        grid_param : dict
            random search grid {Hyperparameter name : values list}
        top_bagging : boolean (Default : False)
            enable Bagging
        n_comb : int (Default : 10)
            HP combination number
        comb_seed : int (Default : None)
            random combination seed
        verbose : boolean (Default False)
            Get logging information

        
train models with random search
creates models with random hyper-parameters combinations from HP grid
fits models on self

Notes .

Available classifiers : Random Forest, XGBOOST
can enable bagging algo with top_bagging parameter

Parameters


train models with random search creates models with random hyper - parameters combinations from HP grid fits models on self Notes . Available classifiers : Random Forest XGBOOST can enable bagging algo with top_bagging parameter Parameters
def model_train(self, clf='XGBOOST', grid_param=None, top_bagging=False, n_comb=10, comb_seed=None, verbose=False):
        assert self.step in ['preprocess', 'features_selection'], 'apply preprocess method'
        df_train = self.copy()
        target = self.target
        if verbose:
            start_time = time()
            print_title1('Train Models')
        hyperopt = HyperOpt(classifier=clf, grid_param=grid_param, n_param_comb=n_comb,
                            bagging=top_bagging, comb_seed=comb_seed)
        if verbose:
            color_print('training models')
        hyperopt.fit(df_train, self.target, verbose=verbose)
        self.d_hyperopt = hyperopt
        self.is_fitted_model = True
        self.target = target
        self.step = 'train_model'
        if verbose:
            print('\n\t\t>>>', 'model_train execution time:', round(time() - start_time, 4), 'secs. <<<')
def model_train ( self , clf = 'XGBOOST' , grid_param = None , top_bagging = False , n_comb = 10 , comb_seed = None , verbose = False ) : assert self . step in [ 'preprocess' , 'features_selection' ] , 'apply preprocess method' df_train = self . copy ( ) target = self . target if verbose : start_time = time ( ) print_title1 ( 'Train Models' ) hyperopt = HyperOpt ( classifier = clf , grid_param = grid_param , n_param_comb = n_comb , bagging = top_bagging , comb_seed = comb_seed ) if verbose : color_print ( 'training models' ) hyperopt . fit ( df_train , self . target , verbose = verbose ) self . d_hyperopt = hyperopt self . is_fitted_model = True self . target = target self . step = 'train_model' if verbose : print ( '\n\t\t>>>' , 'model_train execution time:' , round ( time ( ) - start_time , 4 ) , 'secs. <<<' )
train models with random search
 creates models with random hyper-parameters combinations from HP grid
 fits models on self
train models with random search creates models with random hyper - parameters combinations from HP grid fits models on self
"""train models with random search

        - creates models with random hyper-parameters combinations from HP grid
        - fits models on self

        Notes :

        - Available classifiers : Random Forest, XGBOOST
        - can enable bagging algo with top_bagging parameter

        Parameters
        ----------
        clf : string (Default : 'XGBOOST')
            classifier used for modelisation
        grid_param : dict
            random search grid {Hyperparameter name : values list}
        top_bagging : boolean (Default : False)
            enable Bagging
        n_comb : int (Default : 10)
            HP combination number
        comb_seed : int (Default : None)
            random combination seed
        verbose : boolean (Default False)
            Get logging information

        """ # instantiate Hyperopt object # fit model on train set # fit hyperopt on self
self
clf
grid_param
top_bagging
n_comb
comb_seed
verbose