From 28c6dd47442e44c6f4f902b35e12cd2e5ccbcdb5 Mon Sep 17 00:00:00 2001 From: Magdalena Wilczynska Date: Wed, 5 Jun 2019 17:41:58 +0200 Subject: [PATCH] Simplified input data --- VowpalWabbit/vowpal_utils.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/VowpalWabbit/vowpal_utils.py b/VowpalWabbit/vowpal_utils.py index 6193ddb..52c8a63 100644 --- a/VowpalWabbit/vowpal_utils.py +++ b/VowpalWabbit/vowpal_utils.py @@ -58,9 +58,7 @@ def generate_input(importance): #vowpal config goes here label = moves_mapping[MOVES_LIST[i]] - tag = re.findall("(map_[0-9]+|map[0-9]+_auto)", MAP_NAME)[0] - gc_position = "|GC_Position "+str(coords[0])+","+str(coords[1]) - input_line = str(label) + " " + str(importance) + " " + tag + gc_position+" |GC_Area " + input_line = str(label) + " " + str(importance) + " | " area = get_gc_area(coords, RADIUS) for a in area: @@ -70,6 +68,7 @@ def generate_input(importance): input_file_content.append(input_line) #save to file + tag = re.findall("(map_[0-9]+|map[0-9]+_auto)", MAP_NAME)[0] filename = "./VowpalWabbit/VowPalInputData/input_" + str(tag) + ".txt" input_file = open(filename,"w+") for line in input_file_content: @@ -78,9 +77,8 @@ def generate_input(importance): def pass_input(position): label = 0 - tag = re.findall("(map_[0-9]+|map[0-9]+_auto)", MAP_NAME)[0] gc_position = "|GC_Position "+str(position[0])+","+str(position[1]) - input_line = str(label) + " 1.0 " + tag + gc_position+" |GC_Area " + input_line = str(label) + " 1.0 " + tag + gc_position+" | " area = get_gc_area(position, RADIUS) for a in area: input_line += a + " "