criticality_score icon indicating copy to clipboard operation
criticality_score copied to clipboard

Normalize scores to handle negative weight

Open Jehops opened this issue 4 years ago • 0 comments

Because of the negative weight used for the 'updated_since' signal, calculated criticality scores can take on values outside of the desired range of [0,1]. This was recognized and a workaround was committed in cae562b0e0dd0bf9a043026a77b11f6fd1e1138a.

criticality_score = max(min(criticality_score, 1), 0)

In words, set the score to 1 if the calculated score is greater than 1 and set the score to 0 if the calculated score is less than 0. That workaround removes the convenient interpretation of a score as the proportion of the maximum score. It also removes some information. For example, we miss that a score of 1.03 before the workaround is applied is better than a score of 1.00.

The proposed solution here restores the desired range, preserves the interpretation of a score as the proportion of the maximum score, and does not throw out any information.

Jehops avatar Oct 22 '21 20:10 Jehops