Commit fed1cb40 by Pamela Osuna

no changes

parent 6bd66d16
...@@ -5,7 +5,7 @@ from confusion_matrix import plot_confusion_matrix ...@@ -5,7 +5,7 @@ from confusion_matrix import plot_confusion_matrix
""" """
(c,b,e,o) will be read from the command line or a script (c,b,e,o) will be read from the command line or a script
(c,b,e,o) corresponds to the combinations of the specific hyperparameters (c,b,e,o) corresponds to the combinations of the specific hyperparameters
to build the model to build the model
c belongs to {0,1,2,3} and represents the layer architecture c belongs to {0,1,2,3} and represents the layer architecture
b belongs to {0,1} and represents the batch size b belongs to {0,1} and represents the batch size
...@@ -33,7 +33,7 @@ for params in combinations: ...@@ -33,7 +33,7 @@ for params in combinations:
if avg_auc > max_avg_auc: if avg_auc > max_avg_auc:
max_avg_auc = avg_auc max_avg_auc = avg_auc
max_params = params max_params = params
#%% #%%
print("Best params:",max_params) print("Best params:",max_params)
# once we have chosen the optimal parameters we can do the normal kfold # once we have chosen the optimal parameters we can do the normal kfold
...@@ -43,15 +43,15 @@ acc, auc, cm, pr = cnn.run_kfold(input_, output_, max_params) ...@@ -43,15 +43,15 @@ acc, auc, cm, pr = cnn.run_kfold(input_, output_, max_params)
#%% #%%
labels = [ labels = [
'[~R & ~E]', '[~R & ~E]',
'[~R & E]', '[~R & E]',
'[ R & ~E]', '[ R & ~E]',
'[ R & E]' '[ R & E]'
] ]
#this function saves the matrix image automatically #this function saves the matrix image automatically
plot_confusion_matrix(cm, labels) plot_confusion_matrix(cm, labels)
f = open("out/acc_auc.txt", 'w+') f = open("out/acc_auc.txt", 'w+')
f.write("Average accuracy: " + str(acc)+"\n") f.write("Average accuracy: " + str(acc)+"\n")
f.write("Average area under the curve: " + str(auc)) f.write("Average area under the curve: " + str(auc))
f.close() f.close()
\ No newline at end of file
Markdown is supported
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