-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (21 loc) · 949 Bytes
/
main.py
File metadata and controls
31 lines (21 loc) · 949 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
from utils import createData,plot_performance_curve
from findKthSmall import findKthSmall
import argparse
parser = argparse.ArgumentParser(description='quick select algorithm')
parser.add_argument('--algo',
type=str,
default='divSelect',
help='algorithm name: divSelect, randomSelect')
parser.add_argument('--sizes',
type=str,
default='1000,2000,5000,10000,20000,50000,100000',
help='sizes for data')
args = parser.parse_args()
if __name__ == '__main__':
algo_name = args.algo
sizes = list(map(int, args.sizes.split(',')))
algorithm = findKthSmall(algo_name)
datasets = createData(sizes)
plot_performance_curve(algorithm, datasets)
# python main.py --algo divSelect --sizes 1000,2000,5000,10000,20000,50000,100000
# python main.py --algo randomSelect --sizes 1000,2000,5000,10000,20000,50000,100000