(self, file_path=None, reg_est=2000, reg_depth=40, feat=6)
Train a random forest as the instance selector.
        Note that, if the parameters of the forest is too
        high to your computer, it will take a lot of time
        for training.

        Parameters
        ----------
        file_path: str, optional (default=None)
            The path to the specific data file.

        reg_est: int, optional (default=2000)
            The number of estimators of the forest.

        reg_depth: int, optional (default=40)
            The depth of the forest.

        feat: int, optional (default=6)
            The feat of the forest.
Train a random forest as the instance selector.
        Note that, if the parameters of the forest is too
        high to your computer, it will take a lot of time
        for training.
Train a random forest as the instance selector . Note that if the parameters of the forest is too high to your computer it will take a lot of time for training .
def train_selector_from_file(self, file_path=None, reg_est=2000, reg_depth=40, feat=6):
        """Train a random forest as the instance selector.
        Note that, if the parameters of the forest is too
        high to your computer, it will take a lot of time
        for training.

        Parameters
        ----------
        file_path: str, optional (default=None)
            The path to the specific data file.

        reg_est: int, optional (default=2000)
            The number of estimators of the forest.

        reg_depth: int, optional (default=40)
            The depth of the forest.

        feat: int, optional (default=6)
            The feat of the forest.
        """

        if file_path is None:
            file_path = self._iter_path if self._mode == 'LAL_iterative' else self._rand_path
        else:
            if os.path.isdir(file_path):
                raise ValueError("Please pass the path to a specific file, not a directory.")
        parameters = {'est': reg_est, 'depth': reg_depth, 'feat': feat}
        regression_data = np.load(file_path)
        regression_features = regression_data['arr_0']
        regression_labels = regression_data['arr_1']

        print('Building lal regression model from ' + file_path)
        lalModel1 = RandomForestRegressor(n_estimators=parameters['est'], max_depth=parameters['depth'],
                                          max_features=parameters['feat'], oob_score=True, n_jobs=os.cpu_count())

        lalModel1.fit(regression_features, np.ravel(regression_labels))

        print('Done!')
        print('Oob score = ', lalModel1.oob_score_)
        self._selector = lalModel1
def train_selector_from_file ( self , file_path = None , reg_est = 2000 , reg_depth = 40 , feat = 6 ) : if file_path is None : file_path = self . _iter_path if self . _mode == 'LAL_iterative' else self . _rand_path else : if os . path . isdir ( file_path ) : raise ValueError ( "Please pass the path to a specific file, not a directory." ) parameters = { 'est' : reg_est , 'depth' : reg_depth , 'feat' : feat } regression_data = np . load ( file_path ) regression_features = regression_data [ 'arr_0' ] regression_labels = regression_data [ 'arr_1' ] print ( 'Building lal regression model from ' + file_path ) lalModel1 = RandomForestRegressor ( n_estimators = parameters [ 'est' ] , max_depth = parameters [ 'depth' ] , max_features = parameters [ 'feat' ] , oob_score = True , n_jobs = os . cpu_count ( ) ) lalModel1 . fit ( regression_features , np . ravel ( regression_labels ) ) print ( 'Done!' ) print ( 'Oob score = ' , lalModel1 . oob_score_ ) self . _selector = lalModel1