0
0
ML Pythonprogramming~10 mins

ROC curve and AUC in ML Python - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
Amean_squared_error
Baccuracy_score
Cconfusion_matrix
Droc_curve
Attempts:
3 left
2fill in blank
medium

Complete 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'
Ay_pred
By_scores
Cy_labels
Dy_train
Attempts:
3 left
3fill in blank
hard

Fix 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'
Aroc_auc_score
Baccuracy_score
Croc_curve
Dconfusion_matrix
Attempts:
3 left
4fill in blank
hard

Fill 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'
Afpr
Btpr
Cthresholds
Dy_true
Attempts:
3 left
5fill in blank
hard

Fill 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'
Aroc_auc_score
By_scores
Cauc
Droc_curve
Attempts:
3 left