Use Case And Context -

Logistic Regression in sci-kit learn -

from sklearn.linear_model import LogisticRegression

x = data frame we want but drop target column
y  = the target column i.e df['churn']

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.3,
																									random_state = 42)
#training the model
logreg = LogisticRegression()
logreg.fit(X_train,y_train)

#Making Predictions
y_pred = logreg.predict(X_test)

Predicting Probabilities -

y_pred_probs = logreg.predict_proba(X_test)[:,1]

ROC curve

from sklearn.metrics import roc_curve
fpr, tpr, thresholds = roc_curve(y_test, y_pred_probs)

plt.plot([0,1], [0,1], ["k--"])

plt.plot(fpr,tpr)
plt.xlabel("False Positive Rate")
plt.ylabel("Trrue Positive Rate")
plt.title("Logistics regression ROC curve")

plt.show()

ROC AUC -

form sklearrn.metrics import roc_auc_score
print(roc_auc_score(y_test,y_pred_probs)

Confusion Matrix -