How to Solve NameError: name 'NearestNeighbors' is not defined -- sklearn

Solution: Import the 'NearestNeighbors' module

To Solve the error, add the following line to the top of your code.

from sklearn.neighbors import NearestNeighbors

 

For more information:
Python sklearn NearestNeighbors