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

Solution: Import the 'GridSearchCV, cross_val_score, RandomizedSearchCV' module

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

from sklearn import GridSearchCV

 

For more information:
Python sklearn GridSearchCV