Skip to content
Snippets Groups Projects
Commit 05bdcd6b authored by Laura Christine Kühle's avatar Laura Christine Kühle
Browse files

Removed error for missing classes in ANN evaluation.

parent 2c73fc5e
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ TODO: Test new ANN set-up with Soraya ...@@ -9,7 +9,7 @@ TODO: Test new ANN set-up with Soraya
TODO: Remove object set-up (for more flexibility) TODO: Remove object set-up (for more flexibility)
TODO: Add documentation TODO: Add documentation
TODO: Improve log output (timer, bit of text) -> Done TODO: Improve log output (timer, bit of text) -> Done
TODO: Throw exception for error due to missing classes TODO: Remove error for missing classes -> Done
TODO: Allow multiple approximations in one config TODO: Allow multiple approximations in one config
""" """
...@@ -130,7 +130,8 @@ class ModelTrainer(object): ...@@ -130,7 +130,8 @@ class ModelTrainer(object):
y_true = y_test.detach().numpy()[:, 1] y_true = y_test.detach().numpy()[:, 1]
y_pred = model_output.detach().numpy() y_pred = model_output.detach().numpy()
accuracy = accuracy_score(y_true, y_pred) accuracy = accuracy_score(y_true, y_pred)
precision, recall, f_score, support = precision_recall_fscore_support(y_true, y_pred) precision, recall, f_score, support = precision_recall_fscore_support(y_true, y_pred,
zero_division=0)
auroc = roc_auc_score(y_true, y_pred) auroc = roc_auc_score(y_true, y_pred)
return {'Precision_Smooth': precision[0], 'Precision_Troubled': precision[1], return {'Precision_Smooth': precision[0], 'Precision_Troubled': precision[1],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment