Browse Source

new init (#92)

pull/1/head
Alexandr Velikiy 7 years ago committed by Alexey Velikiy
parent
commit
419ab2e36f
  1. 20
      analytics/utils/__init__.py

20
analytics/utils/__init__.py

@ -79,4 +79,22 @@ def logistic_sigmoid(self, x1, x2, alpha, height):
for i in range(x1, x2):
F = 1 * height / (1 + math.exp(-i * alpha))
distribution.append(F)
return distribution
return distribution
def findOneJump(data, x, size, height, err):
l = []
for i in range(x + 1, x + size):
if (data[i] > data[x] and data[x + size] > data[x] + height):
l.append(data[i])
if len(l) > size * err:
return x
else:
return 0
def findAllJumps(data, size, height):
possible_jump_list = []
for i in range(len(data - size):
x = findOneJump(data, i, size, height, 0.9)
if x > 0:
possible_jump_list.append(x)
return possible_jump_list
Loading…
Cancel
Save