-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.py
60 lines (50 loc) · 1.15 KB
/
index.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from utils.apriori import apriori
from utils.db import fetch_db
from utils.format import print_results
import argparse
parser=argparse.ArgumentParser()
parser.add_argument('--support', help='Support threshold')
parser.add_argument('--confidence', help='Confidence threshold')
amazon = fetch_db('amazon.db')
kmart = fetch_db('kmart.db')
shoprite = fetch_db('shoprite.db')
walmart = fetch_db('walmart.db')
wawa = fetch_db('wawa.db')
args=parser.parse_args()
support = float(args.support) if args.support is not None else .5
confidence = float(args.confidence) if args.confidence is not None else .5
print_results(
'Amazon',
amazon,
apriori(amazon, support, confidence),
support,
confidence
)
print_results(
'Kmart',
kmart,
apriori(kmart, support, confidence),
support,
confidence
)
print_results(
'Shoprite',
shoprite,
apriori(shoprite, support, confidence),
support,
confidence
)
print_results(
'Walmart',
walmart,
apriori(walmart, support, confidence),
support,
confidence
)
print_results(
'Wawa',
wawa,
apriori(wawa, support, confidence),
support,
confidence
)