Skip to content

Instantly share code, notes, and snippets.

@TheLoneNut
Last active February 6, 2019 18:15
Show Gist options
  • Save TheLoneNut/8ffc9adf0ed2f1057989564bc522fbb7 to your computer and use it in GitHub Desktop.
Save TheLoneNut/8ffc9adf0ed2f1057989564bc522fbb7 to your computer and use it in GitHub Desktop.
X = pmi(df)
X = normalize(X, copy=False)
tree = BallTree(X, p=2)
knn_d, knn_ix = tree.query([X[<specific_example>]], k=10, return_distance=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment