We can improve this. antirez has made a highly compelling poc but it could be refined for authorship attribution judging by the number of misses in the comments here, and how this compares to greater accuracy of the original post to which antirez refers. I’m no expert, but some ideas:

- remove super high frequency non specific words from the comparison bags, because they don’t distinguish much, have less semantic value and may skew the data

- remove stop words (NLP definition of stop words)

- perform stemming/tokenization/depluralization etc (again, NLP standard)

- implement commutativity and transitivity in the similarity function

- consider words as hyperlinks to the sets of people who use them often enough, and do something Pageranky to refine similarity

- consider word bigrams, etc

- weight variations and misspellings higher as distinguishing signals

What are your ideas ?