Simplified input data
This commit is contained in:
parent
35fe3314f2
commit
28c6dd4744
@ -58,9 +58,7 @@ def generate_input(importance):
|
|||||||
|
|
||||||
#vowpal config goes here
|
#vowpal config goes here
|
||||||
label = moves_mapping[MOVES_LIST[i]]
|
label = moves_mapping[MOVES_LIST[i]]
|
||||||
tag = re.findall("(map_[0-9]+|map[0-9]+_auto)", MAP_NAME)[0]
|
input_line = str(label) + " " + str(importance) + " | "
|
||||||
gc_position = "|GC_Position "+str(coords[0])+","+str(coords[1])
|
|
||||||
input_line = str(label) + " " + str(importance) + " " + tag + gc_position+" |GC_Area "
|
|
||||||
|
|
||||||
area = get_gc_area(coords, RADIUS)
|
area = get_gc_area(coords, RADIUS)
|
||||||
for a in area:
|
for a in area:
|
||||||
@ -70,6 +68,7 @@ def generate_input(importance):
|
|||||||
input_file_content.append(input_line)
|
input_file_content.append(input_line)
|
||||||
|
|
||||||
#save to file
|
#save to file
|
||||||
|
tag = re.findall("(map_[0-9]+|map[0-9]+_auto)", MAP_NAME)[0]
|
||||||
filename = "./VowpalWabbit/VowPalInputData/input_" + str(tag) + ".txt"
|
filename = "./VowpalWabbit/VowPalInputData/input_" + str(tag) + ".txt"
|
||||||
input_file = open(filename,"w+")
|
input_file = open(filename,"w+")
|
||||||
for line in input_file_content:
|
for line in input_file_content:
|
||||||
@ -78,9 +77,8 @@ def generate_input(importance):
|
|||||||
|
|
||||||
def pass_input(position):
|
def pass_input(position):
|
||||||
label = 0
|
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])
|
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)
|
area = get_gc_area(position, RADIUS)
|
||||||
for a in area:
|
for a in area:
|
||||||
input_line += a + " "
|
input_line += a + " "
|
||||||
|
Loading…
Reference in New Issue
Block a user