-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_graph.py
More file actions
39 lines (29 loc) · 923 Bytes
/
plot_graph.py
File metadata and controls
39 lines (29 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import numpy as np
import pandas as pd
import matplotlib
matplotlib.rcParams['text.usetex'] = True
import matplotlib.pyplot as plt
# select specific datasets
import sys
default_path = ''
if (len(sys.argv) != 1):
default_path = sys.argv[1]
dataset = pd.read_csv('datasets/' + default_path + '.csv')
array = np.load('results/' + default_path + '.npy', allow_pickle=True)
recall_list = []
precision_list = []
test_score_list = []
for experiment in array:
recall_list.append(experiment['recall_score'])
precision_list.append(experiment['precision_score'])
test_score_list.append(experiment['test_score'])
plt.figure()
plt.xlabel(r'Score')
plt.ylabel(r'Recall - Rappel $\frac{TP}{TP+FN}$')
plt.scatter(test_score_list, recall_list)
plt.show()
plt.figure()
plt.xlabel(r'Recall - Rappel $\frac{TP}{TP+FN}$')
plt.ylabel(r'Precision $\frac{TP}{TP+FP}$')
plt.scatter(recall_list, precision_list)
plt.show()