S6 - Data Mining Lab Experiments (Except 1)
S6 - Data Mining Lab Experiments (Except 1)
Datasets [Disclaimer: If New datasets are given than that of the given
ones, use gemini AI support in colab to correct code based on new
dataset given by giving this code as reference.]
plt.figure(figsize=(16, 4))
plt.subplot(1, 3, 1)
plot_tree(clf, feature_names=X.columns, class_names=['rejected',
'approved'], filled=True)
plt.title("Decision Tree")
plt.subplot(1, 3, 2)
ConfusionMatrixDisplay(cm, display_labels=['rejected',
'approved']).plot(cmap='Blues', ax=plt.gca())
plt.title("Confusion Matrix")
plt.subplot(1, 3, 3)
plt.plot(fpr, tpr, label=f'AUC = {roc_auc:.2f}', color='darkorange')
plt.plot([0, 1], [0, 1], 'k--')
plt.xlabel("FPR")
plt.ylabel("TPR")
plt.title("ROC Curve")
plt.legend()
plt.tight_layout()
plt.show()