Commit 4a0d61a9 authored by Nicole Bussola's avatar Nicole Bussola
Browse files

fix model parameter

parent 7ad0ea4d
......@@ -32,11 +32,11 @@ rule all:
rule ml_juxt_tr:
input:
os.path.join(DATAFOLDER, "{dataset}/{target}/{split_id}/{layers}_tr.txt"),
os.path.join(DATAFOLDER, "{dataset}/{target}/{split_id}/labels_{target}_tr.txt")
os.path.join(DATAFOLDER, "{dataset}/{target}/{split_id}/labels_{target}_tr.txt")
output:
"{outfolder}/{dataset}/{target}/{model}/{split_id}/juxt/{layers}_tr_{model}_KBest.log"
shell:
"python sklearn_training.py {input} {wildcards.outfolder}/{wildcards.dataset}/{wildcards.target}/{wildcards.model}/{wildcards.split_id}/juxt --ranking KBest"
"python sklearn_training.py {input} {wildcards.outfolder}/{wildcards.dataset}/{wildcards.target}/{wildcards.model}/{wildcards.split_id}/juxt --model {wildcards.model} --ranking KBest"
rule ml_juxt_val:
......@@ -47,7 +47,7 @@ rule ml_juxt_val:
output:
"{outfolder}/{dataset}/{target}/{model}/{split_id}/juxt/{layers}_tr_MCC_scores.txt"
shell:
"python sklearn_validation.py {input[0]} {input[1]} {wildcards.outfolder}/{wildcards.dataset}/{wildcards.target}/wildcards.model}/{wildcards.split_id}/juxt --tslab {input[2]}"
"python sklearn_validation.py {input[0]} {input[1]} {wildcards.outfolder}/{wildcards.dataset}/{wildcards.target}/{wildcards.model}/{wildcards.split_id}/juxt --tslab {input[2]}"
rule snf:
......@@ -79,7 +79,7 @@ rule ml_rsnf_tr:
output:
"{outfolder}/{dataset}/{target}/{model}/{split_id}/rSNF/{layers}_tr_{model}_rankList.log",
shell:
"python sklearn_training.py {input[0]} {input[1]} {wildcards.outfolder}/{wildcards.dataset}/{wildcards.target}/{wildcards.model}/{wildcards.split_id}/rSNF --ranking rankList --rankFeats {input[2]}"
"python sklearn_training.py {input[0]} {input[1]} {wildcards.outfolder}/{wildcards.dataset}/{wildcards.target}/{wildcards.model}/{wildcards.split_id}/rSNF --model {wildcards.model} --ranking rankList --rankFeats {input[2]}"
rule ml_rsnf_val:
......@@ -131,7 +131,7 @@ rule ml_rsnfi_tr:
output:
"{outfolder}/{dataset}/{target}/{model}/{split_id}/rSNFi/{layers}_tr_{model}_KBest.log"
shell:
"python sklearn_rf_training_fixrank.py {input} {wildcards.outfolder}/{wildcards.dataset}/{wildcards.target}/{wildcards.model}/{wildcards.split_id}/rSNFi --ranking KBest"
"python sklearn_training.py {input} {wildcards.outfolder}/{wildcards.dataset}/{wildcards.target}/{wildcards.model}/{wildcards.split_id}/rSNFi --model {wildcards.model} --ranking KBest"
rule ml_rsnfi_val:
......@@ -155,7 +155,7 @@ rule single_tr:
output:
"{outfolder}/{dataset}/{target}/{model}/{split_id}/single/{layer}_tr_{model}_KBest.log"
shell:
"python sklearn_training.py {input} {wildcards.outfolder}/{wildcards.dataset}/{wildcards.target}/{wildcards.model}/{wildcards.split_id}/single --ranking KBest"
"python sklearn_training.py {input} {wildcards.outfolder}/{wildcards.dataset}/{wildcards.target}/{wildcards.model}/{wildcards.split_id}/single --model LSVM --ranking KBest"
rule single_val:
input:
......@@ -165,4 +165,4 @@ rule single_val:
output:
"{outfolder}/{dataset}/{target}/{model}/{split_id}/single/{layer}_tr_MCC_scores.txt"
shell:
"python sklearn_validation_.py {input[0]} {input[1]} {wildcards.outfolder}/{wildcards.dataset}/{wildcards.target}/{wildcards.model}/{wildcards.split_id}/single --tslab {input[2]}"
"python sklearn_validation.py {input[0]} {input[1]} {wildcards.outfolder}/{wildcards.dataset}/{wildcards.target}/{wildcards.model}/{wildcards.split_id}/single --tslab {input[2]}"
......@@ -96,4 +96,4 @@ for k in range(2, N_LAYERS + 1):
sorted_means = sorted(means.items(), key=operator.itemgetter(1))
borda_df = pd.DataFrame(sorted_means, columns=['FEATURE_NAME', 'MEAN_POS'])
borda_df.to_csv(f"{OUTFOLDER}/{DATASET}/{TARGET}/{MODEL/}Borda_allSplits_{MODE}_{layers_concat}.txt", sep='\t', index=False, float_format="%.3f")
\ No newline at end of file
borda_df.to_csv(f"{OUTFOLDER}/{DATASET}/{TARGET}/{MODEL}/Borda_allSplits_{MODE}_{layers_concat}.txt", sep='\t', index=False, float_format="%.3f")
\ No newline at end of file
......@@ -160,5 +160,5 @@ for k in range(2, N_LAYERS + 1):
df_results = df_results.append(row, ignore_index=True)
df_results.to_csv(f'{OUTFOLDER}/{DATASET}/{TARGET}/{MODEL}/metrics_allSplits_{MODE}.txt', sep='\t', index=False)
df_results.to_csv(f'{OUTFOLDER}/{DATASET}/{TARGET}/{MODEL}/metrics_allSplits_{MODE}_{layers_concat}.txt', sep='\t', index=False)
# %%
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