Hi,

You can use **predict_proba**() and **roc_auc_score** () functions respectively to calculate the predicted probabilities and AUC scores as shown below.

# import necessary functions from modules
from sklearn.model_selection import cross_val_score
from sklearn.metrics import roc_auc_score
# X_test represents test sample
# y_test represents true labels for X_test
# calculate predicted probabilities
y_pred_prob = trainedmodel.predict_proba(X_test)[:,1]
# calculate and print AUC score
print("AUC score: {}".format(roc_auc_score(y_test, y_pred_prob)))
# calculate and print cross-validated AUC scores
print("AUC scores computed using 5-fold cross-validation: {}".format(cross_val_score(trainedmodel, X, y, cv=5, scoring='roc_auc')))

Feel free to review the following references:
DataCamp auc computation,
Scikit Learn roc_auc_score,
Scikit learn metrics.auc,
Scikit learn Logistic regression classifier for more information. Please let me know if know if you have further questions. Thanks.

Regards,

Azure CXP Community.

If a post helps to resolve your issue, please click "**Mark as Answer**" and/or "**Vote
as helpful**". By marking a post as Answered and/or Helpful, you help others find the answer faster. Thanks.