-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestMatplot.py
More file actions
46 lines (40 loc) · 2.56 KB
/
Copy pathtestMatplot.py
File metadata and controls
46 lines (40 loc) · 2.56 KB
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
39
40
41
42
43
44
45
46
import plotly.graph_objects as go
# Data
methods = ['TFIDF', 'LSI', 'Minilm', 'ROBERTA', 'BERT']
metrics = ['Precision', 'Recall', 'F1', 'AUC']
P_numbers = [
[92,68,49,56,43, 91,80,70,73,59, 94,76,67,74,76, 93,67,62,67,55, 92,77,54,60,46, 94,74,60,63,53],
[93,72,44,53,48, 77,53,35,51,38, 93,75,63,67,50, 94,67,57,57,47, 93,71,53,57,45, 92,70,60,65,53],
[92,64,58,65,49, 92,67,57,60,48, 92,77,61,66,47, 90,66,60,62,52, 86,72,61,59,46, 92,71,61,66,51],
[77,63,55,58,48, 89,66,57,62,51, 41,46,21,15,16, 90,70,59,63,52, 71,61,62,51,90, 73,61,63,49,92],
[52,50,57,48,70, 68,55,63,50,86, 71,63,68,49,92, 71,61,62,51,90, 70,56,61,43,78, 73,61,63,49,92]
]
R_numbers = [
[91,59,42,49,43, 86,71,60,63,53, 90,71,54,61,50, 90,66,55,59,50, 89,68,47,51,41, 91,68,55,58,50],
[92,59,41,50,45, 72,52,42,44,39, 89,69,54,59,50, 92,66,50,52,45, 87,67,51,54,45, 90,68,55,58,50],
[90,62,51,53,43, 89,64,52,54,44, 88,70,52,57,48, 84,63,53,56,48, 83,68,53,52,44, 90,68,55,58,50],
[77,57,47,52,44, 86,62,50,58,48, 55,47,29,30,28, 85,67,52,59,47, 69,51,54,47,85, 68,52,57,48,89],
[50,45,52,45,68, 61,47,54,45,82, 65,50,55,45,91, 69,51,54,47,85, 63,47,52,41,71, 68,52,57,47,89]
]
F1_numbers = [
[92,57,40,46,38, 85,68,57,60,49, 88,69,54,60,46, 90,64,55,59,49, 89,67,46,51,40, 91,66,52,55,47],
[92,57,38,47,40, 70,44,33,41,34, 87,67,54,59,46, 91,64,50,51,43, 86,66,51,55,42, 89,66,55,57,47],
[89,60,49,52,41, 89,62,52,54,43, 87,69,52,57,43, 82,62,52,56,46, 82,66,53,52,42, 87,68,53,59,48],
[76,55,45,50,41, 85,60,50,57,47, 42,37,18,17,16, 84,65,52,58,46, 82,62,52,56,46, 86,66,51,55,42],
[49,44,49,41,67, 60,47,55,44,81, 63,50,54,41,90, 67,52,55,45,84, 63,48,53,39,69, 67,52,55,45,88]
]
AUC_numbers = [
[94,76,63,68,50, 86,80,76,81,82, 88,69,52,57,46, 90,70,54,61,50, 86,80,76,81,82, 99,85,74,82,83],
[92,78,65,74,76, 74,77,73,77,80, 98,85,76,82,82, 93,80,72,79,80, 83,77,73,76,76, 98,82,79,85,85],
[92,80,74,78,79, 93,79,75,81,81, 99,85,75,83,83, 97,79,74,80,79, 83,76,72,79,80, 97,81,78,83,84],
[85,74,67,75,76, 89,80,76,83,82, 43,69,52,67,64, 87,76,72,77,77, 78,74,80,79,95, 82,78,83,84,98],
[72,67,75,76,80, 76,73,81,81,86, 85,77,83,83,97, 73,69,75,75,71, 82,78,83,84,98, 82,78,83,84,98]
]
all_numbers = [P_numbers, R_numbers, F1_numbers, AUC_numbers]
# Create Figure
fig = go.Figure()
for j, metric in enumerate(metrics):
for i, method in enumerate(methods):
fig.add_trace(go.Box(y=all_numbers[j][i], name=f'{method}-{metric}'))
fig.update_layout(title_text="Model Performance", xaxis_title='Methods-Metrics', yaxis_title='Scores')
fig.show()