Explore Library
Code QuizAdvanced

Retraining Trigger on Accuracy Drop

Find the bug in logic meant to trigger retraining when accuracy degrades.

Codepython
def should_retrain(current_accuracy, baseline_accuracy, threshold=0.05):
    # Retrain if accuracy has dropped by more than the threshold
    drift = current_accuracy - baseline_accuracy
    if drift > threshold:
        return True
    return False

Why does this function fail to trigger retraining when the model degrades?