# Importing the dependancies from sklearn import metrics # Predicted values y_pred = [0, 1, 1, 0, 1, 1, 1, 1] # Actual values y_act = [0, 1, 0, 0, 1, 1, 1, 1] # Printing the confusion matrix # The columns will show the instances predicted for each label, # and the rows will show the actual number of instances for each label. cm = metrics.confusion_matrix(y_act, y_pred, labels=[0, 1]) # Printing the precision and recall, among other metrics cr = metrics.classification_report(y_act, y_pred, labels=[0, 1])