# Step 6: Evaluation predictions = trainer.predict(small_eval_dataset) # Confusion matrix cm = confusion_matrix(small_eval_dataset['label'], predictions.predictions.argmax(-1)) sns.heatmap(cm, annot=True, fmt='d') plt.title('Confusion Matrix') plt.show() # ROC Curve fpr, tpr, _ = roc_curve(small_eval_dataset['label'], predictions.predictions[:, 1]) roc_auc = auc(fpr, tpr) plt.figure(figsize=(1.618 * 5, 5)) plt.plot(fpr, tpr, color='darkorange', lw=2, label='ROC curve (area = %0.2f)' % roc_auc) plt.plot([0, 1], [0, 1], color='navy', lw=2, linestyle='--') plt.xlim([0.0, 1.0]) plt.ylim([0.0, 1.05]) plt.xlabel('False Positive Rate') plt.ylabel('True Positive Rate') plt.title('Receiver operating characteristic') plt.legend(loc="lower right") plt.show()