<jupyter_start><jupyter_text>Testing the module for identifying preliminary subset of features for a target variable or class ('GBFS.py')<jupyter_code>import GBFS as gb
# Path to training data
path_to_file = '/Users/songyojung/data/classification/df_train_1.pkl'
path_to_save = '/Users/songyojung/data/classification'

path_to_file2 = '/Users/songyojung/data/regression/df_train_2.pkl'
path_to_save2 = '/Users/songyojung/data/regression'

# Initialization 
FS = gb.GBFS(
            path_to_file = path_to_file2, 
            path_to_save = path_to_save2, 
            oversampled_it = False, 
            problem = 'regression'
            )
# Conduct grid search to perform preliminary scan of the hyperparameter space & retrieve a trained model
FS.run(boosting_method = 'lightGBM')
# Obtain feature relevance score
FS.feature_relevance(
                    plot = True, 
                    no_of_features = 20
                    )
# Perform recursive feature selection 
FS.recursive_selection(
                    stratify = False, 
                    oversample_technique = None, 
                    chosen_metric = 'rmse',
                    average = 'weighted',
                    no_to_terminate = 150,
                    max_no_imp = 10
                    )
# Plot the result
FS.convergence_plot()
# Plot the result
FS.convergence_plot(train_metric = 'train_rmse',
                   validation_metric = 'va_rmse'
                   )

# self.result.columns = ['no_of_features', 
#                        'train_mae', 'va_mae', 
#                        'train_mse', 'va_mse', 
#                        'train_rmse', 'va_rmse', 
#                        'train_r_sq', 'va_r_sq', 
#                        'train_max_error', 'va_max_error'
#                        ]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08554083885209714, 'fraction_numerical': 0.00717439293598234, 'mean_word_length': 1.8777777777777778, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '207623', 'license': 'MIT', 'n_tokens_mistral': 576, 'n_tokens_neox': 530, 'n_words': 109, 'path': 'feature_selection_and_analyses/GBFS_regression_testing.ipynb', 'repo_name': 'Songyosk/GBSFS4MPP', 'size': '1812'}