Created
January 12, 2022 18:40
-
-
Save dudo/1affcae4825ba4c0635aa3348ad812a1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.