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

Solution: Import the 'roc_curve, roc_auc_score, accuracy_score, recall_score, precision_score, f1_score' module

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

from sklearn import  f1_score

 

For more information:
Python sklearn f1_score