Created
January 12, 2022 18:40
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def step(min: 1, comp: 20) | |
return 0 if min == comp | |
(1 - (min - comp).abs / (min - comp).to_f) / 2 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use this in monitors all the time to remove flappy, low volume metrics.
For instance... an error rate monitor might
You can compare against the errors or the total in this case.
If b < 1, the step evaluates to 0, otherwise 1.