Simplified input data

This commit is contained in:
Magdalena Wilczynska 2019-06-05 17:41:58 +02:00
parent 35fe3314f2
commit 28c6dd4744

View File

@ -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 + " "