-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Divide by Zero in Weighted Arithmetic Mean Algorithm #314
Comments
cc @calebbrown 👀 |
I think that to emulate a negative weight you need to use the I think that's the way to handle negative signal. |
@jailby I agree that |
Non-positive weights don't make much sense, and should cause an error if supplied.
Other ways of mutating the fields to make them work well in a aggregation function (like WAM) may be necessary (e.g. inverse, diff with another field), but that should be done separately. |
@calebbrown So, should we create errors for zero and negative weights? |
The Weighted Arithmetic Mean algorithm in the wam package currently returns
math.NaN()
whentotalWeight
is zero.Is this intended behavior or should the algorithm return an error in this scenario instead of
math.NaN()
?In other scenarios, returning
math.NaN()
may be fine, but when the total weight of the inputs is zero, it is better to return an error so that the user of the algorithm is aware that the calculation failed and can take appropriate action.criticality_score/internal/scorer/algorithm/wam/wam.go
Line 47 in a3d961d
The text was updated successfully, but these errors were encountered: