Browse Source

Incorrect work of models with single patterns #234 (#235)

add first value of patterns list = val[0] instead 0
pull/1/head
Alexandr Velikiy 6 years ago committed by rozetko
parent
commit
0d921aafb2
  1. 4
      analytics/analytics/utils/common.py

4
analytics/analytics/utils/common.py

@ -212,7 +212,7 @@ def ar_mean(numbers):
def get_av_model(patterns_list): def get_av_model(patterns_list):
x = len(patterns_list[0]) x = len(patterns_list[0])
if len(pattern_list) > 1 and len(patterns_list[1]) != x: if len(patterns_list) > 1 and len(patterns_list[1]) != x:
raise NameError('All elements of patterns_list should have same length') raise NameError('All elements of patterns_list should have same length')
model_pat = [] model_pat = []
for i in range(x): for i in range(x):
@ -238,7 +238,7 @@ def best_pat(pat_list, data, dir):
for val in pat_list: for val in pat_list:
max_val = data[val[0]] max_val = data[val[0]]
min_val = data[val[0]] min_val = data[val[0]]
ind = 0 ind = val[0]
for i in val: for i in val:
if dir == 'max': if dir == 'max':
if data[i] > max_val: if data[i] > max_val:

Loading…
Cancel
Save