Skip to content

Instantly share code, notes, and snippets.

@kentsommer
Created March 17, 2017 06:52
Show Gist options
  • Save kentsommer/0a4a6e0ead306a79168d6f5b9060260f to your computer and use it in GitHub Desktop.
Save kentsommer/0a4a6e0ead306a79168d6f5b9060260f to your computer and use it in GitHub Desktop.
csv_path = "submission_kent.csv"
csv_data = []
csv_data.append(["image_name", "Type_1", "Type_2", "Type_3"])
for index, prediction in enumerate(result):
img_name = data_names[index]
type_1 = '{0:.15f}'.format(prediction[0])
type_2 = '{0:.15f}'.format(prediction[1])
type_3 = '{0:.15f}'.format(prediction[2])
line = [img_name, type_1, type_2, type_3]
print(line)
csv_data.append(line)
csv_writer(csv_data, csv_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment