Skip to content
Snippets Groups Projects
Commit e51f1eee authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 113f4b42
No related branches found
No related tags found
No related merge requests found
......@@ -2609,6 +2609,10 @@ def analyze(preds_file, labels, prob_avg, test_file):
preds = np.where(prob_avg > 0.5, 1, 0)
num_0 = np.sum(nda == 0)
num_1 = np.sum(nda == 1)
num_2 = np.sum(nda == 2)
true_ice = (labels == 1) & (preds == 1)
false_ice = (labels == 0) & (preds == 1)
......@@ -2643,6 +2647,10 @@ def analyze(preds_file, labels, prob_avg, test_file):
mcc_1 = ((tp_1 * tn_1) - (fp_1 * fn_1)) / np.sqrt((tp_1 + fp_1) * (tp_1 + fn_1) * (tn_1 + fp_1) * (tn_1 + fn_1))
mcc_2 = ((tp_2 * tn_2) - (fp_2 * fn_2)) / np.sqrt((tp_2 + fp_2) * (tp_2 + fn_2) * (tn_2 + fp_2) * (tn_2 + fn_2))
acc_0 = np.sum(labels[nda == 0] == preds[nda == 0]) / num_0
acc_1 = np.sum(labels[nda == 1] == preds[nda == 1]) / num_1
acc_2 = np.sum(labels[nda == 2] == preds[nda == 2]) / num_2
print('Total (Positive/Icing Prediction: ')
print('True icing: ', np.sum(true_ice & (nda == 0)), np.sum(true_ice & (nda == 1)), np.sum(true_ice & (nda == 2)))
print('-------------------------')
......@@ -2656,6 +2664,7 @@ def analyze(preds_file, labels, prob_avg, test_file):
print('* False icing (False Positive/False Alarm) *: ', np.sum(false_ice & (nda == 0)), np.sum(false_ice & (nda == 1)), np.sum(false_ice & (nda == 2)))
print('-------------------------')
print('ACC: ', acc_0, acc_1, acc_2)
print('Recall: ', recall_0, recall_1, recall_2)
print('Precision: ', precision_0, precision_1, precision_2)
print('MCC: ', mcc_0, mcc_1, mcc_2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment