-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmodel_to_python_code.py
16 lines (10 loc) · 1.16 KB
/
model_to_python_code.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# A simple python function to perform prediction
def score(input):
return (((((((((((((((((0.7929123964945446) + ((input[0]) * (0.07801862594632314))) + ((input[1]) * (-0.014853900985478468))) + ((input[2]) * (-0.15783041201914427))) + ((input[3]) * (-0.05222073553791883))) + ((input[4]) * (-0.0787403404504791))) + ((input[5]) * (1.3714807410150505))) + ((input[6]) * (0.015077765348160292))) + ((input[7]) * (-0.015077765348160353))) + ((input[8]) * (-0.12161041350915254))) + ((input[9]) * (0.12161041350915253))) + ((input[10]) * (0.09387440269562626))) + ((input[11]) * (-0.09387440269562626))) + ((input[12]) * (-0.0047109053878701835))) + ((input[13]) * (0.004710905387870008))) + ((input[14]) * (-0.14569247529698154))) + ((input[15]) * (0.19858601990225683))) + ((input[16]) * (-0.06417592734444703))
# Test prediction in pure python code
input = [ 1.24474546, 1.9817189 , -0.55448733, 3.02536229, 0.2732313 ,
0.41173269, -0.47234264, 0.47234264, -0.72881553, 0.72881553,
0.52836225, -0.52836225, -2.54711697, 2.54711697, 1.55889948,
-0.7820157 , -0.70020801]
pred = score(input)
print("prediction result: {}".format(int(pred)))