#!/usr/bin/env python
import pickle
import feature_extract
import sys
import random
import numpy as np

random.seed(100)
np.random.seed(100)

record = sys.argv[1]
result_list = ['N', 'A', 'O', '~']

# Load model
model_name = "model_v4"
model_path = model_name + '.dat'
loaded_model = pickle.load(open(model_path, 'rb'))

test_X = feature_extract.FeatureExtractSingle(record)
result = loaded_model.predict(test_X)
answer = result_list[result[0]]

answers_file = open("answers.txt", "a")
answers_file.write("%s,%s\n" % (record, answer))
answers_file.close()
