from annoy import AnnoyIndex
length = 20*4
t = AnnoyIndex(length,metric="angular")

stock_lines = []
with open("/data/quantization/stock.log") as f:
    for x in range(10000):
        stock_lines.append(eval(f.readline()))


i = 0
for stock in stock_lines:
    v = []
    for x in range(len(stock) - 1):
       v.extend(stock[x])
    t.add_item(i, v)
    i = i+1

t.build(40) 
t.save('stock.ann')
