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