|
@@ -69,37 +69,33 @@ def main():
|
|
|
begin, end = p_interval
|
|
|
|
|
|
# check mode to normalize data
|
|
|
+ if p_mode == 'svdne':
|
|
|
|
|
|
- if p_custom:
|
|
|
-
|
|
|
- data = data[begin:end]
|
|
|
+ # set min_max_filename if custom use
|
|
|
+ min_max_file_path = path + '/' + p_metric + min_max_ext
|
|
|
|
|
|
- if p_mode == 'svdne':
|
|
|
+ # need to read min_max_file
|
|
|
+ file_path = os.path.join(os.path.dirname(__file__), min_max_file_path)
|
|
|
+ with open(file_path, 'r') as f:
|
|
|
+ min_val = float(f.readline().replace('\n', ''))
|
|
|
+ max_val = float(f.readline().replace('\n', ''))
|
|
|
|
|
|
- # set min_max_filename if custom use
|
|
|
- min_max_file_path = custom_min_max_folder + '/' + p_custom
|
|
|
+ l_values = processing.normalize_arr_with_range(data, min_val, max_val)
|
|
|
|
|
|
- # need to read min_max_file
|
|
|
- file_path = os.path.join(os.path.dirname(__file__), min_max_file_path)
|
|
|
- with open(file_path, 'r') as f:
|
|
|
- min_val = float(f.readline().replace('\n', ''))
|
|
|
- max_val = float(f.readline().replace('\n', ''))
|
|
|
-
|
|
|
- l_values = processing.normalize_arr_with_range(data, min_val, max_val)
|
|
|
-
|
|
|
- elif p_mode == 'svdn':
|
|
|
- l_values = processing.normalize_arr(data)
|
|
|
- else:
|
|
|
- l_values = data
|
|
|
+ elif p_mode == 'svdn':
|
|
|
+ l_values = processing.normalize_arr(data)
|
|
|
+ else:
|
|
|
+ l_values = data
|
|
|
|
|
|
- test_data = l_values
|
|
|
+ test_data = l_values[begin:end]
|
|
|
|
|
|
- else:
|
|
|
+ # check if custom min max file is used
|
|
|
+ if p_custom:
|
|
|
|
|
|
if p_mode == 'svdne':
|
|
|
|
|
|
# set min_max_filename if custom use
|
|
|
- min_max_file_path = path + '/' + p_metric + min_max_ext
|
|
|
+ min_max_file_path = custom_min_max_folder + '/' + p_custom
|
|
|
|
|
|
# need to read min_max_file
|
|
|
file_path = os.path.join(os.path.dirname(__file__), min_max_file_path)
|
|
@@ -107,16 +103,11 @@ def main():
|
|
|
min_val = float(f.readline().replace('\n', ''))
|
|
|
max_val = float(f.readline().replace('\n', ''))
|
|
|
|
|
|
- l_values = processing.normalize_arr_with_range(data, min_val, max_val)
|
|
|
-
|
|
|
- elif p_mode == 'svdn':
|
|
|
- l_values = processing.normalize_arr(data)
|
|
|
- else:
|
|
|
- l_values = data
|
|
|
+ test_data = processing.normalize_arr_with_range(test_data, min_val, max_val)
|
|
|
|
|
|
- test_data = l_values[begin:end]
|
|
|
+ if p_mode == 'svdn':
|
|
|
+ test_data = processing.normalize_arr(test_data)
|
|
|
|
|
|
- print(data)
|
|
|
|
|
|
# get prediction of model
|
|
|
prediction = model.predict([test_data])[0]
|