implement k-means

poor version :p
plot bug fix

If cluster i has no item, it is not plotted.
simplify
add cosine similarity

implement cos_similarity(d1, d2)