forked from uwdb/Cosette
-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyze_result.py
39 lines (34 loc) · 1.11 KB
/
analyze_result.py
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
import pandas as pd
import matplotlib.pyplot as plt
RESULT_FILE = "./examples/calcite/calcite_result_with_label.csv"
def analyze_result():
"""
analyze calcite result
"""
result = pd.read_csv(RESULT_FILE)
# get frequency of results
result_count = result['Result'].value_counts()
print "Result summary"
print result_count
# filter out passed cases
neq = result['Result'] == "NEQ"
unknown = result['Result'] == "UNKNOWN"
equiv = result['Result'] == "EQ"
manual = result['Result'] == 'MP'
unsupported = result[~(neq|unknown|equiv|manual)]
# get frequency of reasons
print "reasons for unsupported cases"
reason_count = unsupported['Reason'].value_counts()
print reason_count
supported_cases = result[neq|unknown|equiv|manual]
scount = pd.Series(data=[supported_cases.shape[0]], index=["COSETTE_OK"])
agg_count = scount.append(reason_count)
print agg_count
# result_count.plot.bar()
# plt.tight_layout()
# plt.show()
agg_count.plot.bar()
plt.tight_layout()
plt.show()
if __name__ == '__main__':
analyze_result()