This commit is contained in:
Tanushree Tunstall 2022-09-02 10:08:58 +01:00
parent 93e958ae6a
commit f9ce90e3f4
2 changed files with 7 additions and 6 deletions

View file

@ -81,7 +81,7 @@ sys.path.append(homedir + '/git/LSHTM_analysis/scripts/ml/ml_functions')
sys.path sys.path
############################################################################### ###############################################################################
#outdir = homedir + '/git/LSHTM_ML/output/combined/' #outdir = homedir + '/git/LSHTM_ML/output/combined/'
outdir = homedir + '/git/LSHTM_ML/output/test/' outdir = homedir + '/git/LSHTM_ML/output/cg_oversample/'
#==================== #====================
# Import ML functions # Import ML functions
@ -264,7 +264,7 @@ def CMLogoSkf(cm_input_df
, 'y_smnc_cm': y_smnc}) , 'y_smnc_cm': y_smnc})
#%%:Running Multiple models on LOGO with SKF #%%:Running Multiple models on LOGO with SKF
# cD3_v2 = MultModelsCl_logo_skf(input_df = cm_X # two func were identical excpet for name # cD3_v2 = MultModelsCl_logo_skf(input_df = cm_X # two func were identical excpet for name
for i in sampling_names.keys(): for i in sampling_names.keys():
print("thing:", "X"+i+"_cm", "y"+i+"_cm") print("thing:", "X"+i+"_cm", "y"+i+"_cm")
@ -289,14 +289,13 @@ def CMLogoSkf(cm_input_df
, blind_test_target = cm_bts_y , blind_test_target = cm_bts_y
, return_formatted_output = True , return_formatted_output = True
, random_state = 42 , random_state = 42
, n_jobs = os.cpu_count() # the number of jobs should equal the number of CPU cores , n_jobs = os.cpu_count()
) )
outFile = output_dir + str(n_tr_genes+1) + "genes_" + tts_split_type + '_' + file_suffix + i + ".csv" outFile = output_dir + str(n_tr_genes+1) + "genes_" + tts_split_type + '_' + file_suffix + i + ".csv"
cD3_v2.to_csv(outFile) cD3_v2.to_csv(outFile)
# outDict.update({'X' : cm_X # outDict.update({'X' : cm_X
# , 'y' : cm_y # , 'y' : cm_y
# , 'X_bts' : cm_bts_X # , 'X_bts' : cm_bts_X

View file

@ -1,6 +1,8 @@
######################################################################## ########################################################################
# COMBINED Model # COMBINED Model
######################################################################## ########################################################################
# no resampling
time ./cm_logo_skf.py 2>&1 | tee cm_skf-$(date --iso).log time ./cm_logo_skf.py 2>&1 | tee cm_skf-$(date --iso).log
# with resampling
time ./combined_model_iterator.py 2>&1 | tee cm_iterator-$(date --iso).log