0

I am using Pynndescent for the approximate nearest neighbor (ANN) in python for my research project. I follow the same code provided by the author of (Pynndescent). Unfortunately, there is no function in the pynndescent library for the fit/transform so I can predict the result and extract the other evaluations like Precision, recall, f1-score and confusion matrix. Would you please help?

Thank you

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 16 '21 at 22:51
  • Basically, I am trying to use the Pynndescent for my classification problem. Just take the example of the MNIST dataset where we have 10 classes, likewise, my data consists of 11 classes. As I understood, the example given by the author is to find the nearest neighbour but I am doing a bit more for the classification side so it will reduce the memory usage and computation cost. – Syed Shakir Nov 18 '21 at 04:40

1 Answers1

0

PyNNDescent is an approach to computing nearest neighbors, not performing nearest neighbor classification or regression. For the latter you will want something like sklearn's KNeighborsClassifier or KNeighborsRegressor. In more positive news the more recent versions of these support the use of sklearn's KNeighborsTransformer in a pipeline approach. The PyNNDescent library includes a class PyNNDescentTransformer that follows the KNeighborsTransformer API and thus can be used in an equivalent pipeline approach with KNeighborsClassifier or KNeighborsRegressor. See the PyNNDescent documentation on pipelines, documentation on sklearn's KNeighborsTransformer and this example using KNeighborsTransformer for background on how these pieces can be put together. There is, admittedly, limited documentation on this right now.

Leland McInnes
  • 316
  • 2
  • 2