All problems
Performance Decay Monitor
Problem
Monitor model decay: compare the mean error of the last window against the mean error of the first window times threshold. Return True when recent > baseline * threshold.
Return False when errors is shorter than window or window is not positive. If the baseline is non-positive, return True only when the recent mean is positive.
Hint
A threshold of 2 flags when recent error has doubled versus the baseline.
Test cases
case 1
in: [[0.1,0.1,0.1,0.3,0.3,0.3],3,2]
expected: true
case 2
in: [[1,1,1,1],2,2]
expected: false
case 3
in: [[1,2],1,1.5]
expected: true
case 4
in: [[],3,2]
expected: false
Starter codePython
def performance_decay_monitor(errors, window, threshold):
# Your code here
pass4 test cases · run your code against them in the editor