text_plain_output_1.png image_output_1.png
from sklearn.metrics import auc

from sklearn.metrics import roc_curve

from sklearn.metrics import roc_curve, auc

from sklearn.tree import DecisionTreeClassifier

from sklearn.tree import DecisionTreeClassifier
dt = DecisionTreeClassifier(max_depth=10)

dt.fit(x_train, y_train)
dt_predict = dt.predict(x_test)
dt_predict_prob = dt.predict_proba(x_test)

from sklearn.metrics import roc_curve, auc
fpr, tpr, thresholds = roc_curve(y_test, dt_predict_prob[:, 1])
dt_auc = auc(fpr, tpr)
print(dt_auc)