How to Solve NameError: name 'datasets' is not defined -- sklearn
Solution: Import the 'datasets' module
To Solve the error, add the following line to the top of your code.
from sklearn import datasets
For more information:
Python datasets sklearn