import lib_data_operation as tfm_data # Required libraries import os import numpy as np import pandas as pd import warnings warnings.filterwarnings('ignore') from sklearn.model_selection import LeavePGroupsOut # IMPORTING REQUIRED DATASETS df_weight_signaling, df_weight_metabolic_signaling = tfm_data.def_load_weight_pathways( ) df_paper_9437, df_signaling, df_metabolic_signaling = tfm_data.def_load_dataset( ['cell_type'] + list(df_weight_signaling.index.values), ['cell_type'] + list(df_weight_metabolic_signaling.index.values)) # DELETE UNUSED DATASET del (df_weight_signaling) del (df_weight_metabolic_signaling) # DEFAULT VALUES n_cells_out_list = [2, 4, 6, 8] n_experiment_ = 20 # TARGET VARIABLE NAME target_ = 'cell_type' def def_get_n_psplits(X, y, groups, p, n):
for i_scaling in TYPE_OF_SCALING: # THE LOCATION of THE RESULT of SCORE and MODEL # path_hyperband_ = tfm_data.def_check_create_path('kt_result', '') path_hyperband_ = tfm_data.def_check_create_path('kt_result', 'delete') path_output_result = tfm_data.def_check_create_path( 'kt_result', 'design_no_co_' + str(i_scaling)) path_model = tfm_data.def_check_create_path( 'kt_result', 'models_no_co_' + str(i_scaling)) # LOADING REQUIRED DATASETS df_weight_signaling, df_weight_metabolic_signaling = tfm_data.def_load_weight_pathways( ) df_paper, df_signaling, df_metabolic_signaling = tfm_data.def_load_dataset( ['cell_type'] + list(df_weight_signaling.index.values), ['cell_type'] + list(df_weight_metabolic_signaling.index.values), row_scaling=i_scaling, retrieval=False) df_weight_dense = pd.DataFrame(df_paper.columns[1:]).set_index('Sample') for i in range(dense_layer): df_weight_dense['dense' + str(i)] = 1.0 df_weight_paper_signaling_dense_pathway = df_weight_dense.merge( pd.DataFrame(df_paper.columns[1:]).set_index('Sample').merge( df_weight_signaling, left_index=True, right_index=True, how='left').fillna(0), left_index=True, right_index=True, how='inner')