Skip to content

Instantly share code, notes, and snippets.

@jlitven
Last active November 17, 2016 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlitven/e99e62b7c327b0016407443d9acdf58c to your computer and use it in GitHub Desktop.
Save jlitven/e99e62b7c327b0016407443d9acdf58c to your computer and use it in GitHub Desktop.
# Get most similar authors
author = "Aristotle"
most_similar = sort(similarity_matrix[author, ], decreasing=TRUE)
most_similar = most_similar[-1] # exclude top element
most_similar[1:10]
# Output:
# Plato Ralph Waldo Emerson Samuel Johnson Francis Bacon George Bernard Shaw
# 0.3762767 0.3170570 0.3099014 0.2928849 0.2922911
# Blaise Pascal Friedrich Nietzsche John Ruskin Thomas Jefferson Joseph Addison
# 0.2901397 0.2817879 0.2796148 0.2792864 0.2756363
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment