Complete the code to import the library used for detecting model drift.
from sklearn.metrics import [1]
The accuracy_score function helps measure how well a model performs, which is useful for detecting model drift by comparing performance over time.
Complete the code to calculate the accuracy of model predictions.
accuracy = accuracy_score(y_true, [1])The accuracy_score function compares the true labels y_true with the predicted labels y_pred to calculate accuracy.
Fix the error in the code to detect model drift by comparing old and new accuracy.
if new_accuracy [1] old_accuracy - threshold: print('Model drift detected')
Model drift is detected when the new accuracy is less than the old accuracy minus a threshold, indicating performance dropped.
Fill both blanks to create a dictionary that stores accuracy scores for old and new data.
accuracy_scores = {'old': [1], 'new': [2]The dictionary stores the pre-calculated accuracy values old_accuracy and new_accuracy for easy comparison.
Fill all three blanks to complete the code that calculates accuracy for old and new data and checks for drift.
old_accuracy = [1](y_old_true, y_old_pred) new_accuracy = [2](y_new_true, y_new_pred) if new_accuracy [3] old_accuracy - 0.05: print('Model drift detected')
Both accuracies are calculated using accuracy_score. The condition checks if new accuracy dropped below old accuracy minus 0.05, signaling drift.