forked from Windsooon/cherry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunanalysis.py
More file actions
32 lines (27 loc) · 1011 Bytes
/
runanalysis.py
File metadata and controls
32 lines (27 loc) · 1011 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
import cherry
import argparse
parser = argparse.ArgumentParser(description='Native bayes testing.')
parser.add_argument(
'-l', '--language', type=str, default='Chinese',
help='Which language\'s dataset we will use')
parser.add_argument(
'-t', '--test_time', type=int, default=10,
help='How many times we split data for testing')
parser.add_argument(
'-n', '--num', type=int, default=60,
help='How many test data we need every time')
parser.add_argument(
'-p', dest='positive', const=True, action='store_const',
help='Draw ROC curve or not')
parser.add_argument(
'-d', dest='debug', const=True, action='store_const',
help='Show wrong classified data when testing')
args = parser.parse_args()
def main():
print('This may take 5 minutes, Go get a coffee :D.')
a = cherry.analysis(
lan=args.language, test_time=args.test_time,
test_num=args.num, debug=args.debug, positive=args.positive)
print(a.ctable)
if __name__ == '__main__':
main()