Complete the code to import the function that calculates the ROC curve.
from sklearn.metrics import [1]
The roc_curve function is used to compute the false positive rate and true positive rate needed to plot the ROC curve.
Complete the code to calculate the false positive rate and true positive rate for the ROC curve.
fpr, tpr, thresholds = roc_curve(y_true, [1])The ROC curve requires the predicted scores or probabilities, not the predicted classes.
Fix the error in the code to calculate the AUC score.
auc_score = [1](y_true, y_scores)The roc_auc_score function calculates the area under the ROC curve, which measures the model's ability to distinguish classes.
Fill both blanks to plot the ROC curve using matplotlib.
plt.plot([1], [2], label='ROC curve') plt.xlabel('False Positive Rate') plt.ylabel('True Positive Rate') plt.title('ROC Curve') plt.legend()
The ROC curve plots false positive rate (fpr) on the x-axis and true positive rate (tpr) on the y-axis.
Fill all three blanks to compute and print the AUC score after plotting the ROC curve.
auc = [1](y_true, [2]) print(f'AUC score: [3]')
First, compute the AUC score using roc_auc_score with true labels and predicted scores. Then print the computed auc variable.
