Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the function that calculates the ROC curve.
ML Python
from sklearn.metrics import [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
2fill in blank
mediumComplete the code to calculate the false positive rate and true positive rate for the ROC curve.
ML Python
fpr, tpr, thresholds = roc_curve(y_true, [1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
3fill in blank
hardFix the error in the code to calculate the AUC score.
ML Python
auc_score = [1](y_true, y_scores) Drag options to blanks, or click blank then click option'
Attempts:
3 left
4fill in blank
hardFill both blanks to plot the ROC curve using matplotlib.
ML Python
plt.plot([1], [2], label='ROC curve') plt.xlabel('False Positive Rate') plt.ylabel('True Positive Rate') plt.title('ROC Curve') plt.legend()
Drag options to blanks, or click blank then click option'
Attempts:
3 left
5fill in blank
hardFill all three blanks to compute and print the AUC score after plotting the ROC curve.
ML Python
auc = [1](y_true, [2]) print(f'AUC score: [3]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left