changed ml output dirs and ready to run fs

This commit is contained in:
Tanushree Tunstall 2022-07-01 21:40:14 +01:00
parent 57348f1874
commit 11af00f1db
5 changed files with 67 additions and 152 deletions

View file

@ -15,19 +15,19 @@ homedir = os.path.expanduser("~")
sys.path.append(homedir + '/git/LSHTM_analysis/scripts/ml/ml_functions')
sys.path
###############################################################################
outdir = homedir + '/git/LSHTM_ML/output/combined/
#====================
# Import ML functions
#====================
from MultClfs import *
#from MultClfs import *
from MultClfs_logo_skf import *
from GetMLData import *
from SplitTTS import *
# param dict for getmldata()
combined_model_paramD = {'data_combined_model' : False
, 'use_or' : False
, 'omit_all_genomic_features': False
, 'write_maskfile' : False
, 'write_outfile' : False }
# Input data
from ml_data_combined import *
###############################################################################
#ml_genes = ["pncA", "embB", "katG", "rpoB", "gid"]
@ -54,7 +54,7 @@ for gene, drug in ml_gene_drugD.items():
for split_type in split_types:
for data_type in split_data_types:
out_filename = (gene.lower()+'_'+split_type+'_'+data_type+'.csv')
out_filename = outdir + gene.lower()+ '_' + split_type + '_' + data_type + '.csv'
tempD=split_tts(gene_dataD[gene_low]
, data_type = data_type
, split_type = split_type
@ -88,14 +88,8 @@ for gene, drug in ml_gene_drugD.items():
mmDD = {}
for k, v in paramD.items():
scoresD = MultModelsCl(**paramD[k]
, tts_split_type = split_type
, skf_cv = skf_cv
, blind_test_df = tempD['X_bts']
, blind_test_target = tempD['y_bts']
, add_cm = True
, add_yn = True
, return_formatted_output = True)
scoresD = MultModelsCl_logo_skf(**paramD[k]
XXXXXXXXXXXXXXXXXXXXXXX
mmDD[k] = scoresD
# Extracting the dfs from within the dict and concatenating to output as one df