Skip to content

Conversation

@anjsimmo
Copy link
Contributor

Consider the following lines:

        t = ...
        x = abs(condition1.threshold - condition2.threshold)
        ...
        return 1 - (x / t) if x < t else 0

As x (the difference between the two thresholds) is a ratio of t, then t should be the tollerance above which two thresholds are considred different. The tollerance may be proportional to the threshold, e.g. PERMISSIBLE_DELTA * condition1.threshold, but PERMISSIBLE_DELTA * condition1.threshold + condition1.threshold makes no sense (e.g. consider the case where condition1.threshold is negative).

@anjsimmo anjsimmo requested a review from sankhya10 October 12, 2023 07:20
@anjsimmo anjsimmo mentioned this pull request Oct 12, 2023
Copy link
Contributor

@sankhya10 sankhya10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @anjsimmo ,
LGTM, the absolute value works for various scenarios.
I will get it merged.

@sankhya10 sankhya10 merged commit b3c941e into main Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants