-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproductRate.py
More file actions
85 lines (61 loc) · 1.61 KB
/
productRate.py
File metadata and controls
85 lines (61 loc) · 1.61 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import numpy
import json
import random
def product_rating():
data = 0
with open('./training_data/data.txt') as json_data:
data = json.load(json_data)
targets = 0
with open('./training_data/targets.txt') as json_data:
targets = json.load(json_data)
rand = random.randint(1,1000000)
"""MI = data[rand][0];
ME = data[rand][1];
TI = data[rand][2];
RCS = data[rand][3];
Age = data[rand][4];
TA = data[rand][5];
price = 10000;
tar = targets[rand];"""
MI = 1500
ME = 100
TI = 12000
RCS = 0.1
Age = 19
TA = 8000
price = 200
tar = 1
print("mi is %f" % MI);
print("me is %f" % ME);
print("ti is %f" % TI);
print("rcs is %f" % RCS);
print("Age is %f" % Age);
print("ta is %f" % TA);
print("target is %f" % tar);
if(MI/ME <= 0.8):
if(price < 0.1 * MI):
return 5;
else:
return 6;
else:
if(TA <= 10 * ME):
if(price < 0.4 * MI):
if(price <= 0.1 * MI):
return 2;
else:
return 3;
else:
return 4;
else:
if(price <= 0.1 * TA):
if(price < 0.2 * MI):
print("2")
return 2;
else:
return 4;
else:
if(RCS <= 0.3):
return 3;
else:
return 1;
print(product_rating())