Commit 7ad0ea4d authored by Nicole Bussola's avatar Nicole Bussola
Browse files

fix models in output file name

parent 7c1aebdb
......@@ -60,9 +60,9 @@ for k in range(2, N_LAYERS + 1):
for i in range(N_SPLITS):
if MODE == 'rSNF':
file_ranking = os.path.join(OUTFOLDER, DATASET, TARGET, MODEL, f'{i}/{MODE}/{layers_concat}_tr_RandomForest_rankList_ranking.csv.gz')
file_ranking = os.path.join(OUTFOLDER, DATASET, TARGET, MODEL, f'{i}/{MODE}/{layers_concat}_tr_{MODEL}_rankList_ranking.csv.gz')
else:
file_ranking = os.path.join(OUTFOLDER, DATASET, TARGET, MODEL, f'{i}/{MODE}/{layers_concat}_tr_RandomForest_KBest_ranking.csv.gz')
file_ranking = os.path.join(OUTFOLDER, DATASET, TARGET, MODEL, f'{i}/{MODE}/{layers_concat}_tr_{MODEL}_KBest_ranking.csv.gz')
rank = pd.read_csv(file_ranking, header=None, sep='\t').values
rankings.append(rank)
......
......@@ -60,7 +60,7 @@ for k in range(2, N_LAYERS + 1):
all_feats=[]
for i in range(N_SPLITS):
file_featureList = os.path.join(OUTFOLDER, DATASET, TARGET, MODEL, f'{i}/{MODE}/{layers_concat}_tr_RandomForest_KBest_featurelist.txt')
file_featureList = os.path.join(OUTFOLDER, DATASET, TARGET, MODEL, f'{i}/{MODE}/{layers_concat}_tr_{MODEL}_KBest_featurelist.txt')
feats = pd.read_csv(file_featureList, sep='\t')
all_feats.extend(list(feats.FEATURE_NAME))
......@@ -76,7 +76,7 @@ for k in range(2, N_LAYERS + 1):
for i in range(N_SPLITS):
file_featureList = os.path.join(OUTFOLDER, DATASET, TARGET, MODEL, f'{i}/{MODE}/{layers_concat}_tr_RandomForest_KBest_featurelist.txt')
file_featureList = os.path.join(OUTFOLDER, DATASET, TARGET, MODEL, f'{i}/{MODE}/{layers_concat}_tr_{MODEL}_KBest_featurelist.txt')
feats = pd.read_csv(file_featureList, sep='\t')
z=[None]*len(feats)
......@@ -84,7 +84,7 @@ for k in range(2, N_LAYERS + 1):
for k in range(len(feats)):
z[feats.FEATURE_ID[k]]=feats.FEATURE_NAME[k]
file_ranking = os.path.join(OUTFOLDER, DATASET, TARGET, MODEL, f'{i}/{MODE}/{layers_concat}_tr_RandomForest_KBest_ranking.csv.gz')
file_ranking = os.path.join(OUTFOLDER, DATASET, TARGET, MODEL, f'{i}/{MODE}/{layers_concat}_tr_{MODEL}_KBest_ranking.csv.gz')
rankings = pd.read_csv(file_ranking, header=None, sep='\t')
for j in range(CV_K*CV_N):
for k in range(rankings.shape[1]):
......
......@@ -74,12 +74,12 @@ for k in range(2, N_LAYERS + 1):
PATH = f'{OUTFOLDER}/{DATASET}/{TARGET}/{MODEL}/{split_id}'
if MODE == 'rSNF':
file_log = os.path.join(PATH, f'{MODE}/{layers_concat}_tr_RandomForest_rankList.log')
file_metrics = os.path.join(PATH, f'{MODE}/{layers_concat}_tr_RandomForest_rankList_allmetrics.txt')
file_log = os.path.join(PATH, f'{MODE}/{layers_concat}_tr_{MODEL}_rankList.log')
file_metrics = os.path.join(PATH, f'{MODE}/{layers_concat}_tr_{MODEL}_rankList_allmetrics.txt')
else:
file_log = os.path.join(PATH, f'{MODE}/{layers_concat}_tr_RandomForest_KBest.log')
file_metrics = os.path.join(PATH, f'{MODE}/{layers_concat}_tr_RandomForest_KBest_allmetrics.txt')
file_log = os.path.join(PATH, f'{MODE}/{layers_concat}_tr_{MODEL}_KBest.log')
file_metrics = os.path.join(PATH, f'{MODE}/{layers_concat}_tr_{MODEL}_KBest_allmetrics.txt')
with open(file_log) as f:
log_content = f.readlines()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment